参考: http://www.2cto.com/database/201501/371451.html
安装环境 CentOS版本:CentOS-7
因为之前安装过,没有成功,但是有之前安装的文件,要先卸载
网上找了一个卸载的过程如下:
a)查看系统中是否以rpm包安装的mysql:
[root@centos7 ~]# rpm -qa | grep -i mysql
MySQL-server-5.6.17-1.el6.i686
MySQL-client-5.6.17-1.el6.i686
b)卸载mysql
[root@centos7 ~]# rpm -e MySQL-server-5.6.17-1.el6.i686
[root@centos7 ~]# rpm -e MySQL-client-5.6.17-1.el6.i686
c)删除mysql服务
[root@centos7 ~]# chkconfig --list | grep -i mysql
[root@centos7 ~]# chkconfig --del mysql
d)删除分散mysql文件夹
[root@centos7 ~]# whereis mysql 或者 find / -name mysql
mysql: /usr/lib/mysql /usr/share/mysql
清空相关mysql的所有目录以及文件
[root@centos7 ~]#rm -rf /usr/lib/mysql
[root@centos7 ~]#rm -rf /usr/share/mysql
[root@centos7 ~]#rm -rf /usr/my.cnf
下载并安装 官网下载
1. 解压下载的zip包,会发现有以下几个rpm包:
MySQL-client-advanced-5.6.22-1.el7.x86_64.rpm
MySQL-devel-advanced-5.6.22-1.el7.x86_64.rpm
MySQL-embedded-advanced-5.6.22-1.el7.x86_64.rpm
MySQL-server-advanced-5.6.22-1.el7.x86_64.rpm
MySQL-shared-advanced-5.6.22-1.el7.x86_64.rpm
MySQL-shared-compat-advanced-5.6.22-1.el7.x86_64.rpm
MySQL-test-advanced-5.6.22-1.el7.x86_64.rpm
2. 卸载MariaDB(这一步没操作过)
如果直接点击rpm包安装会得到错误提示。因为CentOS的默认数据库已经不再是MySQL了,而是MariaDB,为什么呢?
MariaDB数据库管理系统是MySQL的一个分支,主要由开源社区在维护,采用GPL授权许可。开发这个分支的原因之一是:甲骨文公司收购了MySQL后,有将MySQL闭源的潜在风险,因此社区采用分支的方式来避开这个风险。MariaDB的目的是完全兼容MySQL,包括API和命令行,使之能轻松成为MySQL的代替品。
查看当前安装的mariadb包:
[root@centos7 ~]# rpm -qa | grep mariadb
将它们统统强制性卸载掉:
[root@centos7 ~]# rpm -e --nodeps mariadb-libs-5.5.35-3.el7.x86_64
[root@centos7 ~]# rpm -e --nodeps mariadb-5.5.35-3.el7.x86_64
[root@centos7 ~]# rpm -e --nodeps mariadb-server-5.5.35-3.el7.x86_64
3. 安装MYSQL
按顺序执行
rpm -ivh MySQL-client-advanced-5.6.22-1.el7.x86_64.rpm
rpm -ivh MySQL-devel-advanced-5.6.22-1.el7.x86_64.rpm
rpm -ivh MySQL-server-advanced-5.6.22-1.el7.x86_64.rpm
完成..
4. 启动MYSQL
[root@centos7 mysql]#service mysql start
查看MySQL运行状态:
[root@centos7 mysql]# service mysql status
SUCCESS! MySQL running (14158)
5. 默认root用户登录MYSQL
[root@centos7 mysql]# mysql -u root -p
Enter password:
ERROR 1045 (28000):Access denied for user 'root'@'localhost' (using password: YES)
发现有有错误,然后在网上查了一下说使用下面命令修改root初始化密码:
[root@centos7 mysql]# /usr/bin/mysqladmin -u root password 'passok'
/usr/bin/mysqladmin: connect to server at'localhost' failed
error: 'Accessdenied for user 'root'@'localhost' (using password: NO)'
发现MYSQL数据库默认的root用户还是没办法设置密码进行登录,需要做一下操作:
重置MySQL中root用户密码及验证
还是不行,然后在网上又找到一个重置MySQL中root用户密码及验证的方法:
(1) 停止MySQL服务
[root@centos7 mysql]# service mysql stop
Shutting down MySQL.. SUCCESS!
(2) 输入绕过密码认证命令
[root@centos7 mysql]# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
[1] 5807
150117 22:23:31 mysqld_safe Logging to '/var/lib/mysql/bogon.err'.
150117 22:23:31 mysqld_safe Starting mysqlddaemon with databases from /var/lib/mysql
(3) 输入登录用户命令
[root@centos7 mysql]# mysql -u root mysql
Reading table information for completion oftable and column names
You can turn off this feature to get aquicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version:5.6.22-enterprise-commercial-advanced MySQL Enterprise Server - AdvancedEdition (Commercial)
Copyright (c) 2000, 2014, Oracle and/or itsaffiliates. All rights reserved.
Oracle is a registered trademark of OracleCorporation and/or its
affiliates. Other names may be trademarksof their respective
owners.
Type 'help;' or '\h' for help. Type '\c' toclear the current input statement.
(4)添加用户并赋予权限
mysql> use mysql;
mysql> create database MyShop; //创建一个数据库
//创建一个用户www并具有操作MyShop数据库的权限
mysql> grant all privileges on MyShop.* to 'www'@'localhost' identified by '888888';
mysql> flush privileges;
来查看一下权限
mysql> SELECT DISTINCT CONCAT('User: ''',user,'''@''',host,''';') AS query FROM user;
+------------------------------+
| query |
+------------------------------+
| User: 'root'@'127.0.0.1'; |
| User: 'root'@'::1'; |
| User: 'root'@'centos7'; |
| User: 'www'@'localhost'; |
| User: 'root'@'localhost'; |
+------------------------------+
6 rows in set (0.00 sec)
mysql> show grants for 'www'@'localhost';
+----------------------------------------------------------------------------------------------------------------+
| Grants for www@localhost |
+----------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'www'@'localhost' IDENTIFIED BY PASSWORD '*8E02B7AE57F9A19E165EB45CD3F705BF66985B85' |
| GRANT ALL PRIVILEGES ON `MyShop`.* TO 'www'@'localhost' |
+----------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)
(5) 输入修改root密码SQL语句
mysql> udpate user SET Password=PASSWORD('root') where USER='root';
Query OK, 4 rows affected (0.04 sec)
Rows matched: 4 Changed: 4 Warnings: 0
(6) 输入数据刷新命令
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
(7) 退出
mysql> quit
Bye
(8) 启动MYSQL
[root@centos7 mysql]# service mysql start
Starting MySQL SUCCESS!
参考:http://www.cnblogs.com/XBlack/p/5178758.html
http://www.cnblogs.com/benwu/p/4931944.html
-----------------------------------------------------------------分割-------------------------------------------------------------
以下为参考以上第二个 url博客操作的linux记录:
[root@localhost ~]# cd /
[root@localhost /]# su
[root@localhost /]# rpm -qa | grep mariadb
mariadb-server-5.5.52-1.el7.x86_64
mariadb-libs-5.5.52-1.el7.x86_64
mariadb-embedded-devel-5.5.52-1.el7.x86_64
mariadb-embedded-5.5.52-1.el7.x86_64
mariadb-test-5.5.52-1.el7.x86_64
mariadb-bench-5.5.52-1.el7.x86_64
mariadb-5.5.52-1.el7.x86_64
mariadb-devel-5.5.52-1.el7.x86_64
[root@localhost /]# rpm -e ma
madan-fonts man-db mariadb mariadb-embedded mariadb-server
mailx man-pages mariadb-bench mariadb-embedded-devel mariadb-test
make man-pages-overrides mariadb-devel mariadb-libs marisa
[root@localhost /]# rpm -e ma
madan-fonts man-db mariadb mariadb-embedded mariadb-server
mailx man-pages mariadb-bench mariadb-embedded-devel mariadb-test
make man-pages-overrides mariadb-devel mariadb-libs marisa
[root@localhost /]# rpm -e mariadb-server-5.5.52-1.el7.x86_64
error: Failed dependencies:
mariadb-server(x86-64) = 1:5.5.52-1.el7 is needed by (installed) mariadb-test-1:5.5.52-1.el7.x86_64
[root@localhost /]# ps -ef|grep mysql
root 6374 362 0 17:05 pts/1 00:00:00 /bin/sh /usr/bin/mysqld_safe --defaults-file=/etc/my.cnf --user=root
root 6514 6374 0 17:05 pts/1 00:00:03 /usr/libexec/mysqld --defaults-file=/etc/my.cnf --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=root --log-error=/var/log/mariadb/mariadb.log --pid-file=/var/run/mariadb/mariadb.pid --socket=/var/lib/mysql/mysql.sock
root 10439 10367 0 18:49 pts/2 00:00:00 grep --color=auto mysql
[root@localhost /]# kill -9 6374
[root@localhost /]# ps -ef|grep mysql
root 6514 1 0 17:05 pts/1 00:00:03 /usr/libexec/mysqld --defaults-file=/etc/my.cnf --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=root --log-error=/var/log/mariadb/mariadb.log --pid-file=/var/run/mariadb/mariadb.pid --socket=/var/lib/mysql/mysql.sock
root 10441 10367 0 18:49 pts/2 00:00:00 grep --color=auto mysql
[root@localhost /]# kill -9 6514
[root@localhost /]# ps -ef|grep mysql
root 10605 10367 0 18:50 pts/2 00:00:00 grep --color=auto mysql
[root@localhost /]# rpm -e --nodeps mariadb-server-5.5.52-1.el7.x86_64
warning: /var/log/mariadb/mariadb.log saved as /var/log/mariadb/mariadb.log.rpmsave
[root@localhost /]# rpm -qa | grep mariadb
mariadb-libs-5.5.52-1.el7.x86_64
mariadb-embedded-devel-5.5.52-1.el7.x86_64
mariadb-embedded-5.5.52-1.el7.x86_64
mariadb-test-5.5.52-1.el7.x86_64
mariadb-bench-5.5.52-1.el7.x86_64
mariadb-5.5.52-1.el7.x86_64
mariadb-devel-5.5.52-1.el7.x86_64
[root@localhost /]# rpm -e --nodeps mariadb-libs-5.5.52-1.el7.x86_64
[root@localhost /]# rpm -e --nodeps mariadb-embedded-devel-5.5.52-1.el7.x86_64
[root@localhost /]# rpm -e --nodeps mariadb-embedded-5.5.52-1.el7.x86_64
[root@localhost /]# rpm -e --nodeps mariadb-test-5.5.52-1.el7.x86_64
[root@localhost /]# rpm -e --nodep mariadb-bench-5.5.52-1.el7.x86_64
rpm: --nodep: unknown option
[root@localhost /]# rpm -e --nodep mariadb-devel-5.5.52-1.el7.x86_64
rpm: --nodep: unknown option
[root@localhost /]# rpm -e --nodeps mariadb-devel-5.5.52-1.el7.x86_64
[root@localhost /]# rpm -qa | grep mariadb
mariadb-bench-5.5.52-1.el7.x86_64
mariadb-5.5.52-1.el7.x86_64
[root@localhost /]# rpm -e --nodeps mariadb-bench-5.5.52-1.el7.x86_64
[root@localhost /]# rpm -e --nodeps mariadb-5.5.52-1.el7.x86_64
[root@localhost /]# rpm -qa | grep mariadb
[root@localhost /]# rpm -ivh MySQL-client-advanced-5.6.22-1.el7.x86_64.rpm
error: open of MySQL-client-advanced-5.6.22-1.el7.x86_64.rpm failed: No such file or directory
[root@localhost /]# rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
Retrieving http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
Preparing... ################################# [100%]
Updating / installing...
1:mysql-community-release-el7-5 ################################# [100%]
[root@localhost /]# yum repolist enabled | grep "mysql.*-community.*"
mysql-connectors-community/x86_64 MySQL Connectors Community 30
mysql-tools-community/x86_64 MySQL Tools Community 43
mysql56-community/x86_64 MySQL 5.6 Community Server 306
[root@localhost /]# yum -y install mysql-community-server
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.tuna.tsinghua.edu.cn
* extras: mirrors.cn99.com
* updates: mirrors.tuna.tsinghua.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 0:5.6.35-2.el7 will be installed
--> Processing Dependency: mysql-community-common(x86-64) = 5.6.35-2.el7 for package: mysql-community-server-5.6.35-2.el7.x86_64
--> Processing Dependency: mysql-community-client(x86-64) >= 5.6.10 for package: mysql-community-server-5.6.35-2.el7.x86_64
--> Running transaction check
---> Package mysql-community-client.x86_64 0:5.6.35-2.el7 will be installed
--> Processing Dependency: mysql-community-libs(x86-64) >= 5.6.10 for package: mysql-community-client-5.6.35-2.el7.x86_64
---> Package mysql-community-common.x86_64 0:5.6.35-2.el7 will be installed
--> Running transaction check
---> Package mysql-community-libs.x86_64 0:5.6.35-2.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
===========================================================================================================================================================
Package Arch Version Repository Size
===========================================================================================================================================================
Installing:
mysql-community-server x86_64 5.6.35-2.el7 mysql56-community 59 M
Installing for dependencies:
mysql-community-client x86_64 5.6.35-2.el7 mysql56-community 19 M
mysql-community-common x86_64 5.6.35-2.el7 mysql56-community 257 k
mysql-community-libs x86_64 5.6.35-2.el7 mysql56-community 2.0 M
Transaction Summary
===========================================================================================================================================================
Install 1 Package (+3 Dependent packages)
Total download size: 81 M
Installed size: 350 M
Downloading packages:
warning: /var/cache/yum/x86_64/7/mysql56-community/packages/mysql-community-client-5.6.35-2.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Public key for mysql-community-client-5.6.35-2.el7.x86_64.rpm is not installed
(1/4): mysql-community-client-5.6.35-2.el7.x86_64.rpm | 19 MB 00:00:07
(2/4): mysql-community-libs-5.6.35-2.el7.x86_64.rpm | 2.0 MB 00:00:00
mysql-community-common-5.6.35- FAILED ======- ] 2.8 MB/s | 27 MB 00:00:19 ETA
http://repo.mysql.com/yum/mysql-5.6-community/el/7/x86_64/mysql-community-common-5.6.35-2.el7.x86_64.rpm: [Errno 14] curl#6 - "Could not resolve host: repo.mysql.com; Name or service not known"
Trying other mirror.
(3/4): mysql-community-server-5.6.35-2.el7.x86_64.rpm | 59 MB 00:00:40
Error downloading packages:
mysql-community-common-5.6.35-2.el7.x86_64: [Errno 256] No more mirrors to try.
[root@localhost /]# ps -ef|grep mysql
root 11089 10367 0 19:07 pts/2 00:00:00 grep --color=auto mysql
[root@localhost /]# service mysql start
Redirecting to /bin/systemctl start mysql.service
Failed to start mysql.service: Unit not found.
[root@localhost /]# service mysqld start
Redirecting to /bin/systemctl start mysqld.service
Failed to start mysqld.service: Unit not found.
[root@localhost /]# yum list | grep mysql
mysql-community-release.noarch el7-5 installed
akonadi-mysql.x86_64 1.9.2-4.el7 base
apr-util-mysql.x86_64 1.5.2-6.el7 base
dovecot-mysql.x86_64 1:2.2.10-7.el7 base
freeradius-mysql.x86_64 3.0.4-7.el7_3 updates
libdbi-dbd-mysql.x86_64 0.8.3-16.el7 base
mysql-community-bench.x86_64 5.6.35-2.el7 mysql56-community
mysql-community-client.i686 5.6.35-2.el7 mysql56-community
mysql-community-client.x86_64 5.6.35-2.el7 mysql56-community
mysql-community-common.i686 5.6.35-2.el7 mysql56-community
mysql-community-common.x86_64 5.6.35-2.el7 mysql56-community
mysql-community-devel.i686 5.6.35-2.el7 mysql56-community
mysql-community-devel.x86_64 5.6.35-2.el7 mysql56-community
mysql-community-embedded.i686 5.6.35-2.el7 mysql56-community
mysql-community-embedded.x86_64 5.6.35-2.el7 mysql56-community
mysql-community-embedded-devel.i686 5.6.35-2.el7 mysql56-community
mysql-community-embedded-devel.x86_64 5.6.35-2.el7 mysql56-community
mysql-community-libs.i686 5.6.35-2.el7 mysql56-community
mysql-community-libs.x86_64 5.6.35-2.el7 mysql56-community
mysql-community-server.x86_64 5.6.35-2.el7 mysql56-community
mysql-community-test.x86_64 5.6.35-2.el7 mysql56-community
mysql-connector-java.noarch 1:5.1.25-3.el7 base
mysql-connector-odbc.x86_64 5.3.7-1.el7 mysql-connectors-community
mysql-connector-odbc-debuginfo.x86_64 5.3.7-1.el7 mysql-connectors-community
mysql-connector-odbc-setup.x86_64 5.3.7-1.el7 mysql-connectors-community
mysql-connector-python.noarch 2.0.4-1.el7 mysql-connectors-community
mysql-connector-python.x86_64 2.1.5-1.el7 mysql-connectors-community
mysql-connector-python-cext.x86_64 2.1.5-1.el7 mysql-connectors-community
mysql-connector-python-debuginfo.x86_64 2.1.5-1.el7 mysql-connectors-community
mysql-ref-manual-5.6-en-html-chapter.noarch
1-20170110 mysql56-community
mysql-ref-manual-5.6-en-pdf.noarch 1-20170110 mysql56-community
mysql-router.x86_64 2.0.4-1.el7 mysql-tools-community
mysql-router-debuginfo.x86_64 2.0.4-1.el7 mysql-tools-community
mysql-utilities.noarch 1.6.5-1.el7 mysql-tools-community
mysql-utilities-extra.noarch 1.5.6-1.el7 mysql-tools-community
mysql-workbench-community.x86_64 6.3.9-1.el7 mysql-tools-community
mysql-workbench-community-debuginfo.x86_64
6.3.9-1.el7 mysql-tools-community
pcp-pmda-mysql.x86_64 3.11.3-4.el7 base
php-mysql.x86_64 5.4.16-42.el7 base
php-mysqlnd.x86_64 5.4.16-42.el7 base
qt-mysql.i686 1:4.8.5-13.el7 base
qt-mysql.x86_64 1:4.8.5-13.el7 base
qt5-qtbase-mysql.i686 5.6.1-10.el7 base
qt5-qtbase-mysql.x86_64 5.6.1-10.el7 base
redland-mysql.x86_64 1.0.16-6.el7 base
rsyslog-mysql.x86_64 7.4.7-16.el7 base
[root@localhost /]# yum install mysql-community-common.x86_64
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.tuna.tsinghua.edu.cn
* extras: mirrors.cn99.com
* updates: mirrors.tuna.tsinghua.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-common.x86_64 0:5.6.35-2.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==========================================================================================================================================================================================================
Package Arch Version Repository Size
==========================================================================================================================================================================================================
Installing:
mysql-community-common x86_64 5.6.35-2.el7 mysql56-community 257 k
Transaction Summary
==========================================================================================================================================================================================================
Install 1 Package
Total download size: 257 k
Installed size: 2.1 M
Is this ok [y/d/N]: y
Downloading packages:
No Presto metadata available for mysql56-community
warning: /var/cache/yum/x86_64/7/mysql56-community/packages/mysql-community-common-5.6.35-2.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY ] 0.0 B/s | 116 kB --:--:-- ETA
Public key for mysql-community-common-5.6.35-2.el7.x86_64.rpm is not installed
mysql-community-common-5.6.35-2.el7.x86_64.rpm | 257 kB 00:00:01
Retrieving key from file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Importing GPG key 0x5072E1F5:
Userid : "MySQL Release Engineering <mysql-build@oss.oracle.com>"
Fingerprint: a4a9 4068 76fc bd3c 4567 70c8 8c71 8d3b 5072 e1f5
Package : mysql-community-release-el7-5.noarch (installed)
From : file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
** Found 4 pre-existing rpmdb problem(s), 'yum check' output follows:
perl-DBD-MySQL-4.023-5.el7.x86_64 has missing requires of libmysqlclient.so.18()(64bit)
perl-DBD-MySQL-4.023-5.el7.x86_64 has missing requires of libmysqlclient.so.18(libmysqlclient_18)(64bit)
2:postfix-2.10.1-6.el7.x86_64 has missing requires of libmysqlclient.so.18()(64bit)
2:postfix-2.10.1-6.el7.x86_64 has missing requires of libmysqlclient.so.18(libmysqlclient_18)(64bit)
Installing : mysql-community-common-5.6.35-2.el7.x86_64 1/1
Verifying : mysql-community-common-5.6.35-2.el7.x86_64 1/1
Installed:
mysql-community-common.x86_64 0:5.6.35-2.el7
Complete!
[root@localhost /]# service mysqld start
Redirecting to /bin/systemctl start mysqld.service
Failed to start mysqld.service: Unit not found.
[root@localhost /]# yum -y install mysql-community-server
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.tuna.tsinghua.edu.cn
* extras: mirrors.cn99.com
* updates: mirrors.tuna.tsinghua.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 0:5.6.35-2.el7 will be installed
--> Processing Dependency: mysql-community-client(x86-64) >= 5.6.10 for package: mysql-community-server-5.6.35-2.el7.x86_64
--> Running transaction check
---> Package mysql-community-client.x86_64 0:5.6.35-2.el7 will be installed
--> Processing Dependency: mysql-community-libs(x86-64) >= 5.6.10 for package: mysql-community-client-5.6.35-2.el7.x86_64
--> Running transaction check
---> Package mysql-community-libs.x86_64 0:5.6.35-2.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==========================================================================================================================================================================================================
Package Arch Version Repository Size
==========================================================================================================================================================================================================
Installing:
mysql-community-server x86_64 5.6.35-2.el7 mysql56-community 59 M
Installing for dependencies:
mysql-community-client x86_64 5.6.35-2.el7 mysql56-community 19 M
mysql-community-libs x86_64 5.6.35-2.el7 mysql56-community 2.0 M
Transaction Summary
==========================================================================================================================================================================================================
Install 1 Package (+2 Dependent packages)
Total size: 80 M
Installed size: 348 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : mysql-community-libs-5.6.35-2.el7.x86_64 1/3
Installing : mysql-community-client-5.6.35-2.el7.x86_64 2/3
Installing : mysql-community-server-5.6.35-2.el7.x86_64 3/3
Verifying : mysql-community-client-5.6.35-2.el7.x86_64 1/3
Verifying : mysql-community-libs-5.6.35-2.el7.x86_64 2/3
Verifying : mysql-community-server-5.6.35-2.el7.x86_64 3/3
Installed:
mysql-community-server.x86_64 0:5.6.35-2.el7
Dependency Installed:
mysql-community-client.x86_64 0:5.6.35-2.el7 mysql-community-libs.x86_64 0:5.6.35-2.el7
Complete!
[root@localhost /]# service mysqld start
Redirecting to /bin/systemctl start mysqld.service
[root@localhost /]# ps -ef|grep mysql
mysql 11903 1 0 19:15 ? 00:00:00 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
mysql 12068 11903 3 19:15 ? 00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/lib/mysql/mysql.sock
root 12180 10367 0 19:15 pts/2 00:00:00 grep --color=auto mysql
[root@localhost /]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.35 MySQL Community Server (GPL)
Copyright (c) 2000, 2016, 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.
相关推荐
CentOS 7 安装 MySQL
提供的文档“CentOS7安装mysql5.7.19.docx”和“mysql5.7.19主从配置(CentOS7).docx”应包含更详细的步骤和可能遇到的问题解决方案,建议仔细阅读以获取完整信息。在实际操作过程中,务必遵循最佳实践,确保系统的...
"Centos7安装mysql8.0压缩包" 本文档详细介绍了在Centos7系统上安装mysql8.0的步骤,包括卸载系统自带的mariadb,安装mysql依赖项,上传和解压mysql压缩包,创建安装目录、mysql用户和组,创建数据目录和配置文件,...
解决CentOS 7安装mysql后3306端口不通
CentOS7 安装 MySQL8.0 图文教程 本文将指导读者在 CentOS7 系统中安装 MySQL 8.0,以下是安装过程中需要注意的知识点: 1. 下载 MySQL 安装包:在 MySQL 官方网站下载 MySQL 8.0 安装包,选择 Red Hat 作为操作...
### CentOS7安装MySQL教程 #### 一、简介 在Linux环境下安装MySQL数据库是常见的系统管理任务之一。本文将详细介绍如何在CentOS 7系统上安装MySQL,并提供一系列实用的命令来帮助用户完成整个过程。 #### 二、...
CentOS 7 安装 MySQL 5.7.28 详细完整教程 MySQL 是一种关系型数据库管理系统,广泛应用于各种 Web 应用程序中。在本教程中,我们将详细介绍如何在 CentOS 7 中安装 MySQL 5.7.28。 知识点1:下载 MySQL 源 在...
在本地虚拟机的场合,需要更换yum安装网络地址配置文件CentOS-Base.repo 从阿里云服务器下载一份CentOS-Base.repo文件存到本地
centos7安装mysql方法
### CentOS 7 安装 MySQL 5.7.21 的详细步骤 #### 一、前期准备 在开始安装MySQL之前,确保您的CentOS 7系统已经更新至最新版本,并且具备基本的操作权限。 #### 二、卸载可能存在的MariaDB数据库 CentOS 7系统...
centos7安装mysql8以及常规操作 ------------------------------------- [root@...opt]# vi /etc/my.cnf [mysqld] socket=/var/lib/mysql/mysql.sock log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/...
该文档是关于在centos7安装mysql5.7.22数据库的详细步骤,亲测没有问题
本文将详细介绍如何在CentOS 7上安装MySQL 5.7,基于提供的安装包进行操作。 首先,我们需要了解MySQL的组件结构。在提供的压缩包文件中,包含了以下几个MySQL的组件: 1. `mysql-community-server-5.7.13-1.el7....
首先,让我们关注标题中的"CentOS 7安装MySQL"。CentOS 7是一个基于Linux的开源操作系统,广泛用于服务器部署。MySQL是一款流行的开源关系型数据库管理系统,它提供高效、可靠的数据存储和处理能力。在CentOS 7上...
centos7安装mysql 亲身实操,百分百成功,安装的是mysql5.7
"CentOS 7 安装 MySQL 数据库详解" 在本篇文章中,我们将详细介绍如何在 CentOS 7 中安装 MySQL 数据库,包括解决常见的 bug 和安装过程中可能遇到的问题。 为什么选择 MySQL MySQL 是一个开源的关系型数据库管理...
CentOS 7 安装 MySQL 8.0 本文档将指导你如何在 CentOS 7 上安装 MySQL 8.0,并解决可能遇到的大小写问题和远程访问问题。 一、卸载 CentOS 7 自带的 MariaDB 在安装 MySQL 8.0 之前,我们需要卸载 CentOS 7 自带...
在压缩包文件"centos7安装mysql5.x数据库"中,可能包含了上述所有步骤的详细脚本,用于自动化安装过程。使用这样的脚本可以大大提高效率,特别是在需要批量部署的场景下。在使用前,务必根据实际情况对脚本进行适当...
Centos7安装mysql8