-
[root@shizongger bin]# rpm -qa|grep mysql
-
[root@shizongger bin]# rpm -qa mysql
-
[root@shizongger bin]# rpm -qa|grep -i mysql
-
MySQL-client-5.5.54-1.el7.x86_64
-
[root@shizongger bin]# rpm -e --nodeps M
-
ModemManager ModemManager-glib MySQL-client
- [root@shizongger bin]# rpm -e --nodeps MySQL-client
更新mysql的yum源
- [root@shizongger bin]# wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
-
[root@shizongger bin]# rpm -ivh mysql-community-release-el7-5.noarch.rpm
- [root@shizongger bin]# yum install mysql-community-server
点击(此处)折叠或打开
- [root@shizongger bin]# service mysqld start
mysql监听的段口号是:3306,现在我们来监听3306端口是否已经启动:
点击(此处)折叠或打开
-
[shizongger@shizongger src]$ netstat -anp |grep 3306
-
(Not all processes could be identified, non-owned process info
-
will not be shown, you would have to be root to see it all.)
- tcp6 0 0 :::3306 :::* LISTEN -
-
[root@shizongger bin]# mysql -uroot
-
mysql> set password for 'root'@'localhost' = password('root');
- mysql>exit
-
[root@shizongger bin]# mysql -uroot -proot
-
mysql> show database;
-
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'database' at line 1
-
mysql> show databases;
-
+--------------------+
-
| Database |
-
+--------------------+
-
| information_schema |
-
| mysql |
-
| performance_schema |
- +--------------------+
最后停止mysql服务的命令是:
- [root@shizongger bin]# service mysqld stop