标签:
sudo yum -y install community-mysql-server
会要求输入密码,接下来就是安装了,需要点时间 直到出现 完毕!
systemctl start mysqld.service systemctl enable mysqld.service
mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.6.23 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.
show databases;
+--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | +--------------------+ 3 rows in set (0.00 sec)
--说明information_schema | | mysql | | performance_schema 这三个数据库是mysql自带的,用户最好不要在这里操作
select user, host, password from mysql.user;
+------+-----------------------+-------------------------------------------+ | user | host | password | +------+-----------------------+-------------------------------------------+ | root | localhost | | | root | localhost.localdomain | | | root | 127.0.0.1 | | | root | ::1 | | | | localhost | | | | localhost.localdomain | | +------+-----------------------+-------------------------------------------+ 6 rows in set (0.00 sec)
set password for root@localhost=password(‘XXXX‘);
其中root@localhost @前面的是 user;@后面的是 host ;你可以把XXXXX换成你的密码
mysql -u root -p
输入上述命令后,要求输入对应的密码即可
标签:
原文地址:http://www.cnblogs.com/together-sharing-for-freshman/p/4392495.html