The other as 192.168.1.% with Grant_priv set to N One as localhost with Grant_priv set to Y 'root' will then be put into the user table of mysql database in 2 ways When you create an instance of the server, say you give user name 'root' # The files must end with '.cnf', otherwise they'll be ignored. # * IMPORTANT: Additional settings that can override those from this file! #no-auto-rehash # faster start of mysql but no tab completition # For generating SSL certificates I recommend the OpenSSL GUI "tinyca". # Read the manual, too, if you want chroot! ![]() # Read the manual for more InnoDB related options. # InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/. #binlog_ignore_db = include_database_name ![]() # note: if you are setting up a replication slave, see README.Debian about # The following can be used as easy to replay backup logs or for replication. #log_slow_queries = /var/log/mysql/mysql-slow.log # Here you can see queries with especially long duration #general_log_file = /var/log/mysql/mysql.log # As of 5.1 you can enable the log at runtime! # Be aware that this log type is a performance killer. # Both location gets rotated by the cronjob. # This replaces the startup script and checks MyISAM tables if needed # localhost which is more compatible and is not less secure. # Instead of skip-networking the default is now to listen only on # also need to also adjust /etc/apparmor.d/. # If you make changes to these settings and your system uses apparmor, you may # The following values assume you have at least 32M ram # Here is entries for some specific programs # Remember to edit /etc/mysql/debian.cnf when changing the socket location. # It has been reported that passwords should be enclosed with ticks/quotes # This will be passed to all mysql clients # -print-defaults to see which it would actually understand and use. # Run program with -help to get a list of available options and with # One can use all long options that the program supports. # - "~/.my.cnf" to set user-specific options. # - "/etc/mysql/my.cnf" to set global options, ![]() # The MySQL database server configuration file. Here is my.cnf when it runs, notice the bind field One shot shows how it is not started and other shows it runs I think may have figured out the root of your problem.Hi thanks, but when I put that bind line in, mysql does not start. You can also do it this way (a more elegant solution perhaps) GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP,įinally, you could just remove the CREATE USER privilege (and, of course, the WITH GRANT OPTION) from this answer to have a "super user" who can do everything except create new users. Always test your users after creation - it's very easy to give users too much power. Take a look at the three answers here, here and here for a better idea of what's going on. ![]() Mysql> insert into test values(3, 'testvalue') mysql> create table test (a int, b varchar(10)) mysql> create user IDENTIFIED BY 'mary' ĮRROR 1227 (42000): Access denied you need (at least one of) the CREATE USER privilege(s) for this operationīut, I can do this. There are many more schemas on this server - it's just that myuser can't see them. Show all the schemas myuser can see mysql> show schemas Server version: 5.6.22-log Source distribution Then, on the sport schema, grant ALL to myuser mysql> GRANT ALL ON sport.* TO OK, 0 rows affected (0.02 sec)Įxit and then log on as the new user myuser mysql> inst]$. Grant all privileges on *.* to create user on *.* from privileges Īfter this i logged out of the root account and signed in with the 'user91' account and tried to create another user with this code: create user identified by 'stealth' Īnd this code worked, what should i add in the first block of code in order to prevent 'user91' from creating other users.Īs root: mysql> CREATE USER IDENTIFIED BY 'billy' These are the codes that i used in my root account to create a new user and give him privileges except for the 'create user' privilege: create user identified by 'google' i thought this is would be enough but when i logged in with the new user, i was able to create another user. then i gave him all the privileges, then i revoked the 'create user' privilege from this new user, then i 'flushed privileges'. I tried to create a user through the root account. My task is simple i want to create a user in MySQL server that has all the privileges but excluding the ability to create other users.
0 Comments
Leave a Reply. |