本文主要是介绍MySQL学习笔记2-System administration(set password),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
安装完毕后,第一次登录mysql,修改密码[root@localhost bin]# service mysql start
Starting MySQL.. SUCCESS!
[root@localhost bin]# cat /root/.mysql_secret
# The random password set for the root user at Tue Nov 17 21:33:33 2015 (local time): d08oVJ5RDL5c5YVP
[root@localhost bin]# mysql -pd08oVJ5RDL5c5YVP -uroot
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.27
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> set password for 'root'@'localhost' =password('');
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Bye
[root@localhost bin]# mysql -p -uroot
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.27 MySQL Community Server (GPL)
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> set password for 'root'@'localhost' =password('mysql');
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
[root@localhost bin]#
这篇关于MySQL学习笔记2-System administration(set password)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!