<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://mars.merhot.dk/w/index.php?action=history&amp;feed=atom&amp;title=Mysql_add_user</id>
		<title>Mysql add user - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://mars.merhot.dk/w/index.php?action=history&amp;feed=atom&amp;title=Mysql_add_user"/>
		<link rel="alternate" type="text/html" href="http://mars.merhot.dk/w/index.php?title=Mysql_add_user&amp;action=history"/>
		<updated>2026-05-05T11:34:37Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.29.0</generator>

	<entry>
		<id>http://mars.merhot.dk/w/index.php?title=Mysql_add_user&amp;diff=41578&amp;oldid=prev</id>
		<title>Heth at 09:25, 1 March 2025</title>
		<link rel="alternate" type="text/html" href="http://mars.merhot.dk/w/index.php?title=Mysql_add_user&amp;diff=41578&amp;oldid=prev"/>
				<updated>2025-03-01T09:25:43Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 09:25, 1 March 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l8&quot; &gt;Line 8:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 8:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;mysql&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;mysql&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;CREATE USER 'user1'@'localhost' IDENTIFIED BY 'pass1';&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;CREATE USER 'user1'@'localhost' IDENTIFIED BY 'pass1';&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;create user 'heth'@'localhost' identified by 'Password1'&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Now if you check the mysql.user table you can find a new record in it. Notice that all priviliges are set to No so this user can do nothing in the DB. To add some preiviliges we can use the GRANT command as follows:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Now if you check the mysql.user table you can find a new record in it. Notice that all priviliges are set to No so this user can do nothing in the DB. To add some preiviliges we can use the GRANT command as follows:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Heth</name></author>	</entry>

	<entry>
		<id>http://mars.merhot.dk/w/index.php?title=Mysql_add_user&amp;diff=1693&amp;oldid=prev</id>
		<title>Heth: New page: Category:mysql Syntax &lt;source lang=&quot;sql&quot;&gt; 	CREATE USER user [IDENTIFIED BY [PASSWORD] 'password'] &lt;/source&gt; Here is an example:  &lt;source lang=&quot;mysql&quot;&gt; CREATE USER 'user1'@'localhost' I...</title>
		<link rel="alternate" type="text/html" href="http://mars.merhot.dk/w/index.php?title=Mysql_add_user&amp;diff=1693&amp;oldid=prev"/>
				<updated>2009-02-18T14:59:22Z</updated>
		
		<summary type="html">&lt;p&gt;New page: &lt;a href=&quot;/w/index.php/Category:Mysql&quot; title=&quot;Category:Mysql&quot;&gt;Category:mysql&lt;/a&gt; Syntax &amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt; 	CREATE USER user [IDENTIFIED BY [PASSWORD] &amp;#039;password&amp;#039;] &amp;lt;/source&amp;gt; Here is an example:  &amp;lt;source lang=&amp;quot;mysql&amp;quot;&amp;gt; CREATE USER &amp;#039;user1&amp;#039;@&amp;#039;localhost&amp;#039; I...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:mysql]]&lt;br /&gt;
Syntax&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
	CREATE USER user [IDENTIFIED BY [PASSWORD] 'password']&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Here is an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;mysql&amp;quot;&amp;gt;&lt;br /&gt;
CREATE USER 'user1'@'localhost' IDENTIFIED BY 'pass1';&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now if you check the mysql.user table you can find a new record in it. Notice that all priviliges are set to No so this user can do nothing in the DB. To add some preiviliges we can use the GRANT command as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;mysql&amp;quot;&amp;gt;&lt;br /&gt;
GRANT SELECT,INSERT,UPDATE,DELETE ON *.* TO 'user1'@'localhost';&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Here we have added only the most important priviliges to the user. With the setting above this user is good to run a CMS or a blog, however with such settings this user is not able to install them as it can not create tables. &lt;br /&gt;
&lt;br /&gt;
To add all priviliges to the user you don't have to list all of them but you can use the ALL shortcut as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;mysql&amp;quot;&amp;gt;&lt;br /&gt;
GRANT ALL ON *.* TO 'user1'@'localhost';&lt;br /&gt;
 &lt;br /&gt;
Database F1&lt;br /&gt;
You can create a new MySQL user in one step as well using again the GRANT command with a small extension as here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;mysql&amp;quot;&amp;gt;&lt;br /&gt;
GRANT ALL ON *.* TO 'user2'@'localhost' IDENTIFIED BY 'pass1';&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The above examples used dedicated commands, but sumtimes you maybe want to add a new MySQL user via directly editing the mysql.user table. In this case you just inserts a new record into the table with a normal INSERT command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;mysql&amp;quot;&amp;gt;&lt;br /&gt;
INSERT INTO user (Host,User,Password)&lt;br /&gt;
   VALUES('localhost','user3',PASSWORD('pass3'));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Or you can add some priviliges as well in a form like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;mysql&amp;quot;&amp;gt;&lt;br /&gt;
INSERT INTO user (Host,User,Password,Select_priv,Insert_priv)&lt;br /&gt;
   VALUES('localhost','user4',PASSWORD('pass3'),'Y','Y');&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Heth</name></author>	</entry>

	</feed>