#rpm 安装mysql
#32位
wget #64位
wget http://cdn.mysql.com//Downloads/MySQL-5.6/MySQL-5.6.27-1.linux_glibc2.5.x86_64.rpm-bundle.tar
[root@166087 mysql]# ls -l
总用量 607704
-rw-r--r-- 1 root root 311132160 9月 21 13:25 MySQL-5.6.27-1.linux_glibc2.5.i386.rpm-bundle.tar
-rw-r--r-- 1 7155 wheel 22940013 9月 21 12:32 MySQL-client-5.6.27-1.linux_glibc2.5.i386.rpm
-rw-r--r-- 1 7155 wheel 4193230 9月 21 12:32 MySQL-devel-5.6.27-1.linux_glibc2.5.i386.rpm
-rw-r--r-- 1 7155 wheel 113074786 9月 21 12:32 MySQL-embedded-5.6.27-1.linux_glibc2.5.i386.rpm
-rw-r--r-- 1 7155 wheel 88299856 9月 21 12:33 MySQL-server-5.6.27-1.linux_glibc2.5.i386.rpm
-rw-r--r-- 1 7155 wheel 2372993 9月 21 12:33 MySQL-shared-5.6.27-1.linux_glibc2.5.i386.rpm
-rw-r--r-- 1 7155 wheel 5368256 9月 21 12:33 MySQL-shared-compat-5.6.27-1.linux_glibc2.5.i386.rpm
-rw-r--r-- 1 7155 wheel 74877142 9月 21 12:34 MySQL-test-5.6.27-1.linux_glibc2.5.i386.rpm
#安装
[root@166087 mysql]# yum -y install MySQL-server-5.6.27-1.linux_glibc2.5.i386.rpm
#安装完毕启动
[root@166087 mysql]# /etc/init.d/mysql start
Starting MySQL... ERROR! The server quit without updating PID file (/var/lib/mysql/166087.sys.ipv4.io.pid)
#看日志,yum 安装的 /var/lib/mysql 去寻找
[root@166087 mysql]# cat /var/lib/mysql/166087.sys.ipv4.io.err
2015-10-22 06:58:40 9760 [Note] Server socket created on IP: '::'.
2015-10-22 06:58:40 9760 [ERROR] Can't start server: Bind on TCP/IP port: Address already in use
2015-10-22 06:58:40 9760 [ERROR] Do you already have another mysqld server running on port: 3306 ?
2015-10-22 06:58:40 9760 [ERROR] Aborting
#端口被ss占用了
#kill ss 重新启动就OK了
[root@166087 mysql]# killall ss-server
[root@166087 mysql]# killall ss-server
ss-server: 没有进程被杀死
#启动成功
[root@166087 mysql]# /etc/init.d/mysql start
Starting MySQL. SUCCESS!
#查看yum 安装的默认密码
[root@166087 mysql]# cat /root/.mysql_secret
# The random password set for the root user at Thu Oct 22 06:57:09 2015 (local time): 9XHHrkJz94OIcZux
#安装mysql客户端
[root@166087 mysql]# yum -y install MySQL-client-5.6.27-1.linux_glibc2.5.i386.rpm
[root@166087 mysql]# mysql -uroot -hlocalhost -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
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>
mysql> show databases;
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
mysql>
mysql> set password=password('123456');
Query OK, 0 rows affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.00 sec)
转载于:https://my.oschina.net/web256/blog/520898