mariaDB grant privileges,mariadbprivileges
#copy form my sina blog http://blog.sina.com.cn/s/blog_67c902bd0102w79z.html
>create user MyTest identified by '123456'
#grant privileges>grant all privileges on *.* to 'MyTest'@'%'identified by '123456' with grant option
##grant all privileges on *.* to 'MyTest'@'%'identified by '123456' with grant option
##grant all privileges on *.* to'MyTest'@'192.168.1.1'identified by '123456' withgrant option
##grant all privileges on *.* to'MyTest'@'192.168.1.%' identified by '123456' with grantoption
##grant all privileges on *.* to'MyTest'@'localhost' identified by '123456' with grant option
##grant all privileges on dbName.tableName to'userName'@'host' identified by '123456' with grant ###option
##GRANT SELECT, INSERT, UPDATE, DELETE ON websites TO'techonthenet'@'localhost' identified by ##'123456' with grantoption;
####NOTE: with grant option means that allows youto grant the privileges that you possess to other ####users. if youdon't add this option ,you can't grant the privileges to otherusers,if you have not ####add "identified by '123456'" ,it maybetake error "error 1133[42000] can't find match row...."
# select current user
>select user();
#select users
>use mysql;
>select user[,host] from user;
#show current user databases;
>show databases;
#show current user database tables
>show tables;
###########################################################
FAQ:ERROR 1044 (42000):Access denied for user ''@'localhost'(using password: YES)
reslove:skip grant tables and use mysql to update the record wherehost value is localhost
#>service mysqld stop
#>mysqld_safe --skip-grant-tables
#mysql>mysql
#mysql>use mysql
#mysql>update user set user=root,password=password("123456")where host="localhost";
#mysql>flush privileges;
#mysql>exit ;
#mysql -h 127.0.0.1 -u root -p
#mysql>use mysql
#mysql>grant all privileges on *.* to 'root'@'localhost'identified by '123456' with grant option
#mysql>exit;
本站文章为和通数据库网友分享或者投稿,欢迎任何形式的转载,但请务必注明出处.
同时文章内容如有侵犯了您的权益,请联系QQ:970679559,我们会在尽快处理。