MySQL create user/permissions?

Hello,

MySQL gets installed with root user by default, root user can administer every mysql database installed in the system.
Question is how to create a new user that will not be able to administer all the databases in the system the way as root user is? Can it be done using webmin?

Probably. Also any MySQL admin tools, including the CLI mysql command can do it.

Just remember that MySQL account names are unconnected with Linux account names, and the passwords are stored separately, except that when you run the CLI commands without a -u, the implied account name is the login name.

On 01/14/2010 01:06 AM, ken yap wrote:
>
> Probably. Also any MySQL admin tools, including the CLI mysql command
> can do it.
>
> Just remember that MySQL account names are unconnected with Linux
> account names, and the passwords are stored separately, except that when
> you run the CLI commands without a -u, the implied account name is the
> login name.
>
>

Also notice that MySQL root is not the same as the system root.

I remember the frustration before I discovered this and I’ve noticed
since that I’m not the only one with this obstacle to get started with it.

Vahis

“Sunrise 9:14am (EET), sunset 3:45pm (EET) at Espoo, FI (6:30 hours
daylight)”
http://waxborg.servepics.com
Linux 2.6.25.20-0.5-default #1 SMP 2009-08-14 01:48:11 +0200 x86_64
5:55am up 75 days 10:56, 16 users, load average: 0.23, 0.27, 0.27

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Also note that if you are going to specify a user do so with more than the
username as ‘root’ is not ‘root’ unless it also has the same ‘Host’
column, as ‘root’ from the local box is given super privileges while
‘root’ from ‘%’ (anywhere) is often given a lot of nothing rights-wise.

Good luck.

Vahis wrote:
> On 01/14/2010 01:06 AM, ken yap wrote:
>> Probably. Also any MySQL admin tools, including the CLI mysql command
>> can do it.
>>
>> Just remember that MySQL account names are unconnected with Linux
>> account names, and the passwords are stored separately, except that when
>> you run the CLI commands without a -u, the implied account name is the
>> login name.
>>
>>
>
> Also notice that MySQL root is not the same as the system root.
>
> I remember the frustration before I discovered this and I’ve noticed
> since that I’m not the only one with this obstacle to get started with it.
>
> Vahis
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJLTrFUAAoJEF+XTK08PnB53K8P/RaOUCdpzOSrhaS4UH3wAzwc
9oF9OOGmCZcqlcB2O65S09m0lIzeTyRCFN57nIh/9cdgZ93JNth2LYbRJMlof+uc
ols1vHQ6g/Lu8ukSbq8krWtKEVdLMA/8qR1+M5PwMYJbJN2vdGbL/U70j/HgNJ92
MFgT9tr7Yv7d5Sy6qQ337kBsastqxJr4XuFx68Xe+d8E8WGhAjjoP2XyndqCw8ax
/Aiawwljc8Kg6FvbvjbYoe5zd6u7kkZiB2Q9mP+QoGZZ2av9MymcIlyGVK7GxN2D
+epP0iQ24vccyoRNJTvJj6L4upoG3gD00Hcq3FGD2UEdoAWcpe3ipo5AcHMptKix
UA8U4cEc+0LHotTXnVHeWxsXwb2hm4TYmkXUuFH4k6M3w69TRj1Pr0/Z3PGVklSi
RgYgUqkmkXyTdFrq/mLKJexmKmb2fmssmwoKO7Uu7MOIRafrZqHiB+mgfZkfKLFT
6i7L+x5cEolLgUNifh6wCJXJM2U7Dvle0HQcoY1/E49WoMMCVUzG5eLk75CDvCRD
mqREtIabyTh2vUZus79zqCul+h+hFuu2X/nWrtDVB5COMoeJdqkueu2suk5KUKd/
NhICp4pjaqD8C3DbIAJHuaOTvn2jM4idogAMZH98ulSGBoSf9SZsuVPMK6vWHeoq
A6cCTRv53EngSgd1pRqT
=l7Pp
-----END PGP SIGNATURE-----

phpMyAdmin can do it as well.

And so can Webmin… :wink:

On 01/14/2010 04:56 PM, microchip8 wrote:
>
> And so can Webmin… :wink:
>
>
But the only way (for me) to understand anything about what’s going on,
is by CLI.

Vahis

“Sunrise 9:14am (EET), sunset 3:45pm (EET) at Espoo, FI (6:30 hours
daylight)”
http://waxborg.servepics.com
Linux 2.6.25.20-0.5-default #1 SMP 2009-08-14 01:48:11 +0200 x86_64
5:48pm up 75 days 22:49, 16 users, load average: 0.30, 0.26, 0.19

use mysql
insert into user(host,user,password) values(‘host’,‘user’,PASSWORD(‘password’));
flush privileges;

grand select,insert,update on database.* to ‘user’@‘host’ identified by ‘password’;

Here I’ve just given select,insert and update as privileges; see info mysql for full list.

Note that you should delete these lines from mysql_history afterwards as they will be accessible to anyone who can access your user account.