CentOS下yum安装mysql

  其实跟windows下安装过程差别不大,就是下载为了方便使用了yum的方式。安装前先确认下系统是否还安装mysql,卸载是否不完全,再去官网(http://dev.mysql.com/downloads/repo/yum/)选一个yum版本,这里我选了最新的mysql80-community-release-el7-3.noarch.rpm,通过wget下载后就可以安装mysql服务端了,然后就算完了。是不是很简单?当然为了使用方便,跟windows的一样,最好再改下初始密码。下面看下操作记录:

1、检查下是否已下载还有卸载残留

# rpm -qa | grep mysql# find / -name mysql
/etc/selinux/targeted/active/modules/100/mysql
/usr/lib64/mysql
/usr/share/mysql

  看来还是有的,通过rm -rf将以上目录删掉即可,另外顺便把配置文件/etc/my.cnf也删掉吧,用rm -f。

2、安装yum

# wget http://repo.mysql.com/mysql80-community-release-el7-3.noarch.rpm
--2019-05-04 07:00:43--  http://repo.mysql.com/mysql80-community-release-el7-3.noarch.rpm
Resolving repo.mysql.com (repo.mysql.com)... 23.41.23.231
Connecting to repo.mysql.com (repo.mysql.com)|23.41.23.231|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 26024 (25K) [application/x-redhat-package-manager]
Saving to: 鈥榤ysql80-community-release-el7-3.noarch.rpm鈥

100%[==============================================================================================================================>] 26,024      --.-K/s   in 0.1s    

2019-05-04 07:00:43 (223 KB/s) - 鈥榤ysql80-community-release-el7-3.noarch.rpm鈥saved [26024/26024]

3、安装mysql

# sudo rpm -Uvh mysql80-community-release-el7-3.noarch.rpm
warning: mysql80-community-release-el7-3.noarch.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:mysql80-community-release-el7-3  ################################# [100%]
[[email protected]_0_17_centos mysql]# yum install -y mysql-community-server
Loaded plugins: fastestmirror, langpacks
epel                                                                                                                                             | 4.7 kB  00:00:00
extras                                                                                                                                           | 3.4 kB  00:00:00
mysql-connectors-community                                                                                                                       | 2.5 kB  00:00:00
mysql-tools-community                                                                                                                            | 2.5 kB  00:00:00
mysql80-community                                                                                                                                | 2.5 kB  00:00:00
os                                                                                                                                               | 3.6 kB  00:00:00
updates                                                                                                                                          | 3.4 kB  00:00:00
(1/7): extras/7/x86_64/primary_db                                                                                                                | 201 kB  00:00:00
(2/7): epel/7/x86_64/updateinfo                                                                                                                  | 991 kB  00:00:00
(3/7): epel/7/x86_64/primary_db                                                                                                                  | 6.7 MB  00:00:00
(4/7): mysql-connectors-community/x86_64/primary_db                                                                                              |  41 kB  00:00:00
(5/7): mysql-tools-community/x86_64/primary_db                                                                                                   |  58 kB  00:00:00
(6/7): mysql80-community/x86_64/primary_db                                                                                                       |  62 kB  00:00:00
(7/7): updates/7/x86_64/primary_db                                                                                                               | 4.2 MB  00:00:00
Determining fastest mirrors
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 0:8.0.16-1.el7 will be installed
--> Processing Dependency: mysql-community-common(x86-64) = 8.0.16-1.el7 for package: mysql-community-server-8.0.16-1.el7.x86_64
--> Processing Dependency: mysql-community-client(x86-64) >= 8.0.11 for package: mysql-community-server-8.0.16-1.el7.x86_64
--> Processing Dependency: libnuma.so.1(libnuma_1.2)(64bit) for package: mysql-community-server-8.0.16-1.el7.x86_64
--> Processing Dependency: libnuma.so.1(libnuma_1.1)(64bit) for package: mysql-community-server-8.0.16-1.el7.x86_64
--> Processing Dependency: libnuma.so.1()(64bit) for package: mysql-community-server-8.0.16-1.el7.x86_64
--> Running transaction check
---> Package mysql-community-client.x86_64 0:8.0.16-1.el7 will be installed
--> Processing Dependency: mysql-community-libs(x86-64) >= 8.0.11 for package: mysql-community-client-8.0.16-1.el7.x86_64
---> Package mysql-community-common.x86_64 0:8.0.16-1.el7 will be installed
---> Package numactl-libs.x86_64 0:2.0.9-7.el7 will be installed
--> Running transaction check
---> Package mariadb-libs.x86_64 1:5.5.56-2.el7 will be obsoleted
--> Processing Dependency: libmysqlclient.so.18()(64bit) for package: 2:postfix-2.10.1-6.el7.x86_64
--> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: 2:postfix-2.10.1-6.el7.x86_64
---> Package mysql-community-libs.x86_64 0:8.0.16-1.el7 will be obsoleting
--> Running transaction check
---> Package mysql-community-libs-compat.x86_64 0:8.0.16-1.el7 will be obsoleting
---> Package postfix.x86_64 2:2.10.1-6.el7 will be updated
---> Package postfix.x86_64 2:2.10.1-7.el7 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================================================
 Package                                            Arch                          Version                                Repository                                Size
========================================================================================================================================================================
Installing:
 mysql-community-libs                               x86_64                        8.0.16-1.el7                           mysql80-community                        3.0 M
     replacing  mariadb-libs.x86_64 1:5.5.56-2.el7
 mysql-community-libs-compat                        x86_64                        8.0.16-1.el7                           mysql80-community                        2.1 M
     replacing  mariadb-libs.x86_64 1:5.5.56-2.el7
 mysql-community-server                             x86_64                        8.0.16-1.el7                           mysql80-community                        403 M
Installing for dependencies:
 mysql-community-client                             x86_64                        8.0.16-1.el7                           mysql80-community                         32 M
 mysql-community-common                             x86_64                        8.0.16-1.el7                           mysql80-community                        575 k
 numactl-libs                                       x86_64                        2.0.9-7.el7                            os                                        29 k
Updating for dependencies:
 postfix                                            x86_64                        2:2.10.1-7.el7                         os                                       2.4 M

Transaction Summary
========================================================================================================================================================================
Install  3 Packages (+3 Dependent packages)
Upgrade             ( 1 Dependent package)

Total download size: 443 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
warning: /var/cache/yum/x86_64/7/mysql80-community/packages/mysql-community-common-8.0.16-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY:44 ETA
Public key for mysql-community-common-8.0.16-1.el7.x86_64.rpm is not installed
(1/7): mysql-community-common-8.0.16-1.el7.x86_64.rpm                                                                                            | 575 kB  00:00:01
(2/7): mysql-community-libs-8.0.16-1.el7.x86_64.rpm                                                                                              | 3.0 MB  00:00:00
(3/7): mysql-community-libs-compat-8.0.16-1.el7.x86_64.rpm                                                                                       | 2.1 MB  00:00:00
(4/7): numactl-libs-2.0.9-7.el7.x86_64.rpm                                                                                                       |  29 kB  00:00:00
(5/7): postfix-2.10.1-7.el7.x86_64.rpm                                                                                                           | 2.4 MB  00:00:00
(6/7): mysql-community-client-8.0.16-1.el7.x86_64.rpm                                                                                            |  32 MB  00:00:20
(7/7): mysql-community-server-8.0.16-1.el7.x86_64.rpm                                                                                            | 403 MB  00:00:48
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                   8.7 MB/s | 443 MB  00:00:50
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Importing GPG key 0x5072E1F5:
 Userid     : "MySQL Release Engineering <[email protected]>"
 Fingerprint: a4a9 4068 76fc bd3c 4567 70c8 8c71 8d3b 5072 e1f5
 Package    : mysql80-community-release-el7-3.noarch (installed)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
  Installing : mysql-community-common-8.0.16-1.el7.x86_64                                                                                                           1/9
  Installing : mysql-community-libs-8.0.16-1.el7.x86_64                                                                                                             2/9
  Installing : mysql-community-client-8.0.16-1.el7.x86_64                                                                                                           3/9
  Installing : mysql-community-libs-compat-8.0.16-1.el7.x86_64                                                                                                      4/9
  Installing : numactl-libs-2.0.9-7.el7.x86_64                                                                                                                      5/9
  Installing : mysql-community-server-8.0.16-1.el7.x86_64                                                                                                           6/9
  Updating   : 2:postfix-2.10.1-7.el7.x86_64                                                                                                                        7/9
  Cleanup    : 2:postfix-2.10.1-6.el7.x86_64                                                                                                                        8/9
  Erasing    : 1:mariadb-libs-5.5.56-2.el7.x86_64                                                                                                                   9/9
warning: file /usr/share/mysql/ukrainian/errmsg.sys: remove failed: No such file or directory
warning: file /usr/share/mysql/ukrainian: remove failed: No such file or directory
warning: file /usr/share/mysql/swedish/errmsg.sys: remove failed: No such file or directory
warning: file /usr/share/mysql/swedish: remove failed: No such file or directory
warning: file /usr/share/mysql/spanish/errmsg.sys: remove failed: No such file or directory
warning: file /usr/share/mysql/spanish: remove failed: No such file or directory
warning: file /usr/share/mysql/slovak/errmsg.sys: remove failed: No such file or directory
warning: file /usr/share/mysql/slovak: remove failed: No such file or directory
warning: file /usr/share/mysql/serbian/errmsg.sys: remove failed: No such file or directory
warning: file /usr/share/mysql/serbian: remove failed: No such file or directory
warning: file /usr/share/mysql/russian/errmsg.sys: remove failed: No such file or directory
warning: file /usr/share/mysql/russian: remove failed: No such file or directory
warning: file /usr/share/mysql/romanian/errmsg.sys: remove failed: No such file or directory
warning: file /usr/share/mysql/romanian: remove failed: No such file or directory
warning: file /usr/share/mysql/portuguese/errmsg.sys: remove failed: No such file or directory
warning: file /usr/share/mysql/portuguese: remove failed: No such file or directory
warning: file /usr/share/mysql/polish/errmsg.sys: remove failed: No such file or directory
warning: file /usr/share/mysql/polish: remove failed: No such file or directory
warning: file /usr/share/mysql/norwegian/errmsg.sys: remove failed: No such file or directory
warning: file /usr/share/mysql/norwegian-ny/errmsg.sys: remove failed: No such file or directory
warning: file /usr/share/mysql/norwegian-ny: remove failed: No such file or directory
warning: file /usr/share/mysql/norwegian: remove failed: No such file or directory
warning: file /usr/share/mysql/korean/errmsg.sys: remove failed: No such file or directory
warning: file /usr/share/mysql/korean: remove failed: No such file or directory
warning: file /usr/share/mysql/japanese/errmsg.sys: remove failed: No such file or directory
warning: file /usr/share/mysql/japanese: remove failed: No such file or directory
warning: file /usr/share/mysql/italian/errmsg.sys: remove failed: No such file or directory
warning: file /usr/share/mysql/italian: remove failed: No such file or directory
warning: file /usr/share/mysql/hungarian/errmsg.sys: remove failed: No such file or directory
warning: file /usr/share/mysql/hungarian: remove failed: No such file or directory
warning: file /usr/share/mysql/greek/errmsg.sys: remove failed: No such file or directory
warning: file /usr/share/mysql/greek: remove failed: No such file or directory
warning: file /usr/share/mysql/german/errmsg.sys: remove failed: No such file or directory
warning: file /usr/share/mysql/german: remove failed: No such file or directory
warning: file /usr/share/mysql/french/errmsg.sys: remove failed: No such file or directory
warning: file /usr/share/mysql/french: remove failed: No such file or directory
warning: file /usr/share/mysql/estonian/errmsg.sys: remove failed: No such file or directory
warning: file /usr/share/mysql/estonian: remove failed: No such file or directory
warning: file /usr/share/mysql/english/errmsg.sys: remove failed: No such file or directory
warning: file /usr/share/mysql/english: remove failed: No such file or directory
warning: file /usr/share/mysql/dutch/errmsg.sys: remove failed: No such file or directory
warning: file /usr/share/mysql/dutch: remove failed: No such file or directory
warning: file /usr/share/mysql/danish/errmsg.sys: remove failed: No such file or directory
warning: file /usr/share/mysql/danish: remove failed: No such file or directory
warning: file /usr/share/mysql/czech/errmsg.sys: remove failed: No such file or directory
warning: file /usr/share/mysql/czech: remove failed: No such file or directory
warning: file /usr/share/mysql/charsets/swe7.xml: remove failed: No such file or directory
warning: file /usr/share/mysql/charsets/macroman.xml: remove failed: No such file or directory
warning: file /usr/share/mysql/charsets/macce.xml: remove failed: No such file or directory
warning: file /usr/share/mysql/charsets/latin7.xml: remove failed: No such file or directory
warning: file /usr/share/mysql/charsets/latin5.xml: remove failed: No such file or directory
warning: file /usr/share/mysql/charsets/latin2.xml: remove failed: No such file or directory
warning: file /usr/share/mysql/charsets/latin1.xml: remove failed: No such file or directory
warning: file /usr/share/mysql/charsets/koi8u.xml: remove failed: No such file or directory
warning: file /usr/share/mysql/charsets/koi8r.xml: remove failed: No such file or directory
warning: file /usr/share/mysql/charsets/keybcs2.xml: remove failed: No such file or directory
warning: file /usr/share/mysql/charsets/hp8.xml: remove failed: No such file or directory
warning: file /usr/share/mysql/charsets/hebrew.xml: remove failed: No such file or directory
warning: file /usr/share/mysql/charsets/greek.xml: remove failed: No such file or directory
warning: file /usr/share/mysql/charsets/geostd8.xml: remove failed: No such file or directory
warning: file /usr/share/mysql/charsets/dec8.xml: remove failed: No such file or directory
warning: file /usr/share/mysql/charsets/cp866.xml: remove failed: No such file or directory
warning: file /usr/share/mysql/charsets/cp852.xml: remove failed: No such file or directory
warning: file /usr/share/mysql/charsets/cp850.xml: remove failed: No such file or directory
warning: file /usr/share/mysql/charsets/cp1257.xml: remove failed: No such file or directory
warning: file /usr/share/mysql/charsets/cp1256.xml: remove failed: No such file or directory
warning: file /usr/share/mysql/charsets/cp1251.xml: remove failed: No such file or directory
warning: file /usr/share/mysql/charsets/cp1250.xml: remove failed: No such file or directory
warning: file /usr/share/mysql/charsets/ascii.xml: remove failed: No such file or directory
warning: file /usr/share/mysql/charsets/armscii8.xml: remove failed: No such file or directory
warning: file /usr/share/mysql/charsets/README: remove failed: No such file or directory
warning: file /usr/share/mysql/charsets/Index.xml: remove failed: No such file or directory
warning: file /usr/share/mysql/charsets: remove failed: No such file or directory
warning: file /usr/share/mysql: remove failed: No such file or directory
warning: file /usr/lib64/mysql/plugin/mysql_clear_password.so: remove failed: No such file or directory
warning: file /usr/lib64/mysql/plugin/dialog.so: remove failed: No such file or directory
warning: file /usr/lib64/mysql/libmysqlclient.so.18.0.0: remove failed: No such file or directory
  Verifying  : numactl-libs-2.0.9-7.el7.x86_64                                                                                                                      1/9
  Verifying  : mysql-community-client-8.0.16-1.el7.x86_64                                                                                                           2/9
  Verifying  : mysql-community-libs-compat-8.0.16-1.el7.x86_64                                                                                                      3/9
  Verifying  : 2:postfix-2.10.1-7.el7.x86_64                                                                                                                        4/9
  Verifying  : mysql-community-libs-8.0.16-1.el7.x86_64                                                                                                             5/9
  Verifying  : mysql-community-server-8.0.16-1.el7.x86_64                                                                                                           6/9
  Verifying  : mysql-community-common-8.0.16-1.el7.x86_64                                                                                                           7/9
  Verifying  : 1:mariadb-libs-5.5.56-2.el7.x86_64                                                                                                                   8/9
  Verifying  : 2:postfix-2.10.1-6.el7.x86_64                                                                                                                        9/9 

Installed:
  mysql-community-libs.x86_64 0:8.0.16-1.el7          mysql-community-libs-compat.x86_64 0:8.0.16-1.el7          mysql-community-server.x86_64 0:8.0.16-1.el7         

Dependency Installed:
  mysql-community-client.x86_64 0:8.0.16-1.el7               mysql-community-common.x86_64 0:8.0.16-1.el7               numactl-libs.x86_64 0:2.0.9-7.el7              

Dependency Updated:
  postfix.x86_64 2:2.10.1-7.el7                                                                                                                                         

Replaced:
  mariadb-libs.x86_64 1:5.5.56-2.el7                                                                                                                                    

Complete!

  上面的安装过程有点长,可以看到它默认给我们安装了最新版本的mysql8,当然你也可以自己指定版本。另外它在安装时会去删掉原有的卸载残留,不过因为我们已经提前删掉了,所以会出现那一堆warnning提示删除卸载残留文件时没找到文件。

4、启动mysql

# service mysqld start
Redirecting to /bin/systemctl start mysqld.service
# service mysqld status
Redirecting to /bin/systemctl status mysqld.service
鈼[0m mysqld.service - MySQL Server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: active (running) since Sat 2019-05-04 07:10:32 CST; 15s ago
     Docs: man:mysqld(8)
           http://dev.mysql.com/doc/refman/en/using-systemd.html
  Process: 11678 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
 Main PID: 11772 (mysqld)
   Status: "SERVER_OPERATING"
   CGroup: /system.slice/mysqld.service
           鈹斺攢11772 /usr/sbin/mysqld

May 04 07:10:18 VM_0_17_centos systemd[1]: Starting MySQL Server...
May 04 07:10:32 VM_0_17_centos systemd[1]: Started MySQL Server.

5、找初始密码

# grep ‘temporary password‘ /var/log/mysqld.log
2019-05-03T23:10:26.160286Z 5 [Note] [MY-010454] [Server] A temporary password is generated for [email protected]: c-uo(;XAc2FD

  这里的c-uo(;XAc2FD就是我的初始密码,复制它去登陆mysql。

6、登陆并修改密码

# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.16

Copyright (c) 2000, 2019, 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> ALTER USER ‘root‘@‘localhost‘ IDENTIFIED BY ‘[email protected]‘;
Query OK, 0 rows affected (0.03 sec)

  这里说下密码规则:8位以上,大小写字母、数字和特殊字母。

7、创建个新库来用:

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.00 sec)

mysql> create database test;
Query OK, 1 row affected (0.03 sec)

mysql> use test;
Database changed
mysql> show tables;
Empty set (0.00 sec)

8、重启mysql,使用新密码登陆,开始接入应用

# service mysqld restart
Redirecting to /bin/systemctl restart mysqld.service

  这里我是给安装mysql的机器自己用的,所以没有开发端口给远程。需要本地远程机器的话还得再设置一下,这里就不展开了。

原文地址:https://www.cnblogs.com/wuxun1997/p/10807466.html

时间: 2024-10-12 02:16:46

CentOS下yum安装mysql的相关文章

CentOS下yum安装mysql,jdk以及tomcat

首先说明,服务器是阿里云的,centos6.3_64位安全加固版.首先需要登陆进来,使用的是putty,因为最初的时候,Xshell登陆会被拒绝. 0. 创建个人文件夹 [java] view plaincopy # 使用 yum 安装tomcat 和 mysql # 创建文件夹 cd /usr/local mkdir renfufei 1. 安装rzsz [java] view plaincopy # 1. 安装rzsz yum update -y yum list lrzsz* yum in

centos下yum安装mysql5.6后,无法启动 MySQL Daemon failed to start

如果是全新安装应该就不会出现这个问题,升级安装的话,要运行 mysql_upgrade ,但是启动MYSQL就报错MySQL Daemon failed to start 如此就没办法运行mysql_upgrade升级MYSQL表了 因为是全新安装的数据库服务器就不管老数据了,直接把老的MYSQL数据库文件夹删除了,然后 运行 mysql_install_db 单独执行下命令,初始化mysql,test等数据库 初始化所有数据库以后,依然是无法启动,检查了MYSQL的日志发现没有权限,因为是RO

RHEL5.6环境下yum安装MySQL

RHEL5.6环境下yum安装MySQL记录,2017年2月20日 1.卸载原有的MySQL rpm -qa命令查询是否安装了MySQL [[email protected] mysql]# rpm -qa|grep mysql mysql-server-5.0.77-4.el5_5.4 mysql-5.0.77-4.el5_5.4 使用rpm -e命令卸载安装包,如果卸载时提示依赖可以增加"--nodeps"参数: 如果想删除依赖项则直接卸载依赖项后再删除相应的包. [[email 

centos下yum安装lamp和lnmp轻松搞定

centos下yum安装lamp和lnmp轻松搞定,到底多轻松你看就知道了,妈妈再也不担心不会装lamp了. 很辛苦整理的安装方法,会持续更新下去.凡无法安装的在评论里贴出问题来,会尽快解决.共同维护一个可用yum可用更新. 软件列表:php5.4 apache2.2 mysql5.5 nginx1.8 centos6.x rpm -Uvh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ng

centos下yum安装lamp

CentOS下yum安装LAMP   1. 用yum安装Apache,Mysql,PHP. 1.1安装Apache yum install httpd httpd-devel 安装完成后,用/etc/init.d/httpd start 启动apache 设为开机启动:chkconfig httpd on 1.2 安装mysql 1.2.1 yum install mysql mysql-server mysql-devel 同样,完成后,用/etc/init.d/mysqld start 启动

Linux下yum安装MySQL

写这篇文章的原因是:在刚开始使用Linux操作系统时想要搭建LAMP环境,于是开始在Google和百度上各种寻找资料,碰到了不是很多的问题后,我决定写这篇文章总结一下在Linux下yum安装MySQL数据库的过程,至于编译安装,我这里没法做过多的补充,因为我不想去妄言一个我还没有完全掌握的知识,各位见谅,以后搞明白了会补上的. 好了,我们直接进入正题: Linux 下 yum安装mysql 1. wget http://dev.mysql.com/get/mysql57-community-re

Centos下Yum安装PHP5.5,5.6,7.0

Centos下Yum安装PHP5.5,5.6,7.0 默认的版本太低了,手动安装有一些麻烦,想采用Yum安装的可以使用下面的方案: 1.检查当前安装的PHP包 yum list installed | grep php 如果有安装的PHP包,先删除他们 yum remove php.x86_64 php-cli.x86_64 php-common.x86_64 php-gd.x86_64 php-ldap.x86_64 php-mbstring.x86_64 php-mcrypt.x86_64 

centos 下yum 安装nginx

centos 下yum 安装nginx 1. 直接yum install nginx不行,要先处理下源: rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm 2. 查看源: yum info nginx 这时会提示有可安装的软件包 nginx | 2.9 kB 00:00nginx/primary_db | 15 kB 00:00可安装的软件包Nam

Centos使用yum安装mysql

Centos下使用yum安装mysql客户端.服务器端,以及启动.登录和远程访问.  1.安装 查看有没有安装过: yum list installed mysql* rpm -qa | grep mysql* 查看有没有安装包: yum list mysql* 安装mysql客户端: yum install mysql 安装mysql 服务器端: yum install mysql-server yum install mysql-devel 2.启动&&停止 数据库字符集设置 mysq