MySQL5.6_Linux安装
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Mysql安装过程(linux:2.6.18-194.el5,Mysql:)
1、安装
[root@RAC2 mysql]# rpm -ivh MySQL-server-5.6.12-2.rhel5.x86_64.rpm Preparing...
########################################### [100%]
1:MySQL-server
########################################### [100%]
[root@RAC2 mysql]# rpm -ivh MySQL-client-5.6.12-2.rhel5.x86_64.rpm Preparing...
########################################### [100%]
1:MySQL-client
########################################### [100%]
2、安装完查看默认3306端口没有开
[root@RAC2 mysql]# netstat -nat
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:833 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 :::22 :::* LISTEN
tcp 0
0 ::ffff:192.168.72.5:22 ::ffff:192.168.72.1:63851 ESTABLISHED
tcp 0
0 ::ffff:192.168.72.5:22 ::ffff:192.168.72.1:62929 ESTABLISHED
3、将mysql启动
[root@RAC2 init.d]# service mysql start
Starting MySQL..[确定]
4、再次确认端口是打开的
[root@RAC2 init.d]# netstat -nat
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:833 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:111 0.0.0.0:*
LISTEN
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 :::3306 :::* LISTEN
tcp 0 0 :::22 :::* LISTEN
tcp 0
0 ::ffff:192.168.72.5:22 ::ffff:192.168.72.1:63851 ESTABLISHED
tcp 0
0 ::ffff:192.168.72.5:22 ::ffff:192.168.72.1:62929 ESTABLISHED
5、连接mysql
[root@RAC2 bin]# mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
在网上查资料,可以这样来解决:
[root@RAC2 bin]# /etc/init.d/mysql stop
Shutting down MySQL..[确定]
[root@RAC2 bin]# mysqld_safe --user=mysql --skip-grant-tables
--skip-networking &
[1] 6025
[root@RAC2 bin]# 130716 19:00:36 mysqld_safe Logging to
'/var/lib/mysql/RAC2.err'.
130716 19:00:36 mysqld_safe Starting mysqld daemon with databases from
/var/lib/mysql
[root@RAC2 bin]# mysql -u root mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.12 MySQL Community Server (GPL)
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;
+--------------------+
| Database |
+--------------------+