error: Failed dependencies:
libaio.so.1()(64bit) is needed by MySQL-server-5.6.10-1.rhel5.x86_64
libaio.so.1(LIBAIO_0.1)(64bit) is needed by MySQL-server-5.6.10-1.rhel5.x86_64
libaio.so.1(LIBAIO_0.4)(64bit) is needed by MySQL-server-5.6.10-1.rhel5.x86_64
需要使用yum命令快速安装依赖包libaio,运行如下命令:
[root@AY130221101729bc93912 software]# rpm -ivh MySQL-server-5.6.10-1.rhel5.x86_64.rpm
Preparing ########################################### [100%]
1:MySQL-server ########################################### [100%]
2013-02-22 09:03:18 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
…….
A random root password has been set. You will find it in '/root/.mysql_secret'.
2013-02-22 09:03:25 4132 [Note] Binlog end
2013-02-22 09:03:25 4132 [Note] InnoDB: FTS optimize thread exiting.
……
安装完成后会生成root用户的随机密码,请使用“cat /root/.mysql_secret”或类似命令进行查看。
[root@AY130221101729bc93912 mysql]# whereis mysql
mysql: /usr/bin/mysql /usr/include/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz
3.5 启动MySQL
安装完成后mysql是没有启动的,运行mysql命令会提示如下错误:
[root@AY130221101729bc93912 software]# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
可使用如下命令启动MySQL:
[root@AY130221101729bc93912 mysql]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.6.10
Copyright (c) 2000, 2013, 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> show databases;
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
可使用SET PASSWORD命令修改root用户的密码,参考如下:
mysql> SET PASSWORD = PASSWORD('root123456');
Query OK, 0 rows affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+