MariaDB [(一)]祝辞,select 版本(); + - - - - - - - - - - - - - - - - - + |,版本(),,,,,| + - - - - - - - - - - - - - - - - - + | |,5.5.52-MariaDB  + - - - - - - - - - - - - - - - - - + 1,row set 拷贝;(0.18,sec)
MariaDB [(一)]祝辞use mysql MariaDB (mysql)祝辞,select 用户,host 得到mysql.user; + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + | |,user host ,,,,,,,,,,,,,,,,, | + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + | |,root 127.0.0.1 ,,,,,,,,,,,, | | |,root :: 1,,,,,,,,,,,,,,,,,,, | |,,,,,,|,localhost ,,,,,,,,,,,, | | |,root localhost ,,,,,,,,,,,, | |,,,,,,|,lvs-dr01.saltstack.com | | |,root lvs-dr01.saltstack.com | + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 6,rows set 拷贝;(0.03,sec) MariaDB (mysql)祝辞,delete 得到mysql.user where (用户、主机),not 拷贝(select ‘根’,' localhost '); Query 好吧,,5,rows affected (0.05,秒) MariaDB (mysql)祝辞,select 用户,host 得到mysql.user; + - - - - - - - - - - - - - - - - - - + | |,user host ,,,, | + - - - - - - - - - - - - - - - - - - + | |,root localhost | + - - - - - - - - - - - - - - - - - - + 1,row set 拷贝;(0.05,sec)
默认的mysql管理账号
MariaDB (mysql)祝辞,update user set 用户=癮dmin”, where 用户=案? MariaDB (mysql)祝辞,update mysql.user set 用户=癮dmin”,密码=密码(“redhat12345”); Query 好吧,,1,row affected (0.08,秒) Rows 匹配:,1,,改变:,1,,警告:0 MariaDB (mysql)祝辞,flush 特权; Query 好吧,,0,rows affected (0.03,秒) (root@LVS-DR01 ~) #, mysql -uadmin - p 'redhat12345 MariaDB [(一)]祝辞,user mysql; MariaDB (mysql)祝辞,show 餐桌;
MariaDB (mysql)祝辞,select 用户,host 得到mysql.user; + - - - - - - - - - - - - - - - - - - - + | |,user 还以为;host ,,,, | + - - - - - - - - - - - - - - - - - - - + | |,admin localhost | + - - - - - - - - - - - - - - - - - - - + 1,row set 拷贝;(0.00,sec)
删除测试数据库:
MariaDB (mysql)祝辞,drop database 测试; MariaDB (mysql)祝辞,flush 特权; MariaDB [(一)]祝辞,show 数据库; + - - - - - - - - - - - - - - - - - - - - - - + |,Database ,,,,,,,,, | + - - - - - - - - - - - - - - - - - - - - - - + | |,information_schema  |,mysql ,,,,,,,,,,,, | | |,performance_schema  + - - - - - - - - - - - - - - - - - - - - - - + 3,rows set 拷贝;(0.06,sec)
MariaDB (mysql)祝辞,select *,得到mysql.db where db like ‘测试% \ G * * * * * * * * * * * * * * * * * * * * * * * * * * *,1只row * * * * * * * * * * * * * * * * * * * * * * * * * * * ,,,,,,,,,,,,,,,,主持人:% ,,,,,,,,,,,,,,,,,,Db:测试 ,,,,,,,,,,,,,,,,用户:, ,,,,,,,,,Select_priv: Y ,,,,,,,,,Insert_priv: Y ,,,,,,,,,Update_priv: Y ,,,,,,,,,Delete_priv: Y ,,,,,,,,,Create_priv: Y ,,,,,,,,,,,Drop_priv: Y ,,,,,,,,,,Grant_priv: N ,,,,,References_priv: Y ,,,,,,,,,,Index_priv: Y ,,,,,,,,,,Alter_priv: Y Create_tmp_table_priv: Y null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null安装完mysql数据库后的优化(删除多余用户和数据库)