yum remove mysql mysql-server mysql-libs mysql-server;
|
find / -name mysql
|
MySQL-client-advanced-5.6.20-1.el6.i686.rpm #MySQL客户端程序
MySQL-devel-advanced-5.6.20-1.el6.i686.rpm #MySQL的库和头文件
MySQL-embedded-advanced-5.6.20-1.el6.i686.rpm #MySQL的嵌入式程序
MySQL-server-advanced-5.6.20-1.el6.i686.rpm #MySQL服务端程序
MySQL-shared-advanced-5.6.20-1.el6.i686.rpm #MySQL的共享库
MySQL-shared-compat-advanced-5.6.20-1.el6.i686.rpm #RHEL兼容包
MySQL-test-advanced-5.6.20-1.el6.i686.rpm #MySQL的测试组件
|
MySQL-client-advanced-5.6.20-1.el6.i686.rpm
MySQL-devel-advanced-5.6.20-1.el6.i686.rpm
MySQL-server-advanced-5.6.20-1.el6.i686.rpm
|
rpm -qa | grep -i mysql
|
yum -y remove mysql-libs*
|
rpm -ivh MySQL-server-advanced-5.6.20-1.el6.i686.rpm
rpm -ivh MySQL-devel-advanced-5.6.20-1.el6.i686.rpm
rpm -ivh MySQL-client-advanced-5.6.20-1.el6.i686.rpm
|
cp /usr/share/mysql/my-default.cnf /etc/my.cnf
|
/usr/bin/mysql_install_db #初始化MySQL
service mysql start #启动MySQL
cat /root/.mysql_secret #查看root账号的初始密码,会出现下述所示信息
mysql -uroot -pZFRmqNPoFH3aO5PU #使用root账号登陆MySQL
set password=password(‘123456‘); #更改MySQL密码,注意;不可少
exit #退出
mysql -uroot -p123456 #使用新密码登陆
|
use mysql;
mysql> select host,user,password from user;
+-----------+------+-------------------------------------------+
| host | user | password |
+-----------+------+-------------------------------------------+
| localhost | root | *DFEB299B8A17E376E7804A115F471149953B5645 |
| chenxu | root | *6E4C48EDF3CC66BC5F6E6C0980935C8ED660EFAA |
| 127.0.0.1 | root | *6E4C48EDF3CC66BC5F6E6C0980935C8ED660EFAA |
| ::1 | root | *6E4C48EDF3CC66BC5F6E6C0980935C8ED660EFAA |
+-----------+------+-------------------------------------------+
4 rows in set (0.00 sec)
mysql> update user set password=password(‘aqjccmtj‘) where user=‘root‘;
Query OK, 3 rows affected (0.00 sec)
Rows matched: 4 Changed: 3 Warnings: 0
mysql> update user set host=‘%‘ where user=‘root‘ and host=‘localhost‘;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
|
[root@favccxx local]# chkconfig mysql on [root@favccxx local]# chkconfig --list | grep mysql mysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off |
character_set_server=utf8
character_set_client=utf8
collation-server=utf8_general_ci
lower_case_table_names=1
max_connections=1000
|
/var/lib/mysql/ #数据库目录
#启动脚本 |
原文地址:http://blog.csdn.net/shehun1/article/details/38827631