【Linux is Not Unix】centos安装
1、官方安装文档
http://dev.mysql.com/doc/mysql-yum-repo-quick-guide/en/
2、下载 Mysql yum包
http://dev.mysql.com/downloads/repo/yum/
下载到本地再上传到服务器,或者使用wget 直接下载
wget http://repo.mysql.com/mysql57-community-release-el7-10.noarch.rpm
3、安转软件源
将platform-and-version-specific-package-name 替换为你下载的rpm名
sudo rpm -Uvh platform-and-version-specific-package-name.rpm
例如
rpm -Uvh mysql57-community-release-el7-10.noarch.rpm
4、安装mysql服务端
yum install -y mysql-community-server
5、首先启动mysql
service mysqld start
(重启是restart,完全弄好MySQL后最好添加lower_case_table_names=1到[mysqld]下面一行然后重启MySQL,这是为了和windows兼容,还有就是在[mysql]下面一行加入default-character-set=utf8)
systemctl start mysqld.service(这个是上面步骤执行后自动输出的,我这边的全称是:Redirecting to /bin/systemctl start mysqld.service)
然后回到[…]#
6、接着检查mysql 的运行状态
service mysqld status
systemctl status mysqld.service(也是系统自动输出的,我这边全称是:Redirecting to /bin/systemctl status mysqld.service)
然后会输出一大段关于MySQL状态的信息:
mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: active (running) since 日 2017-07-30 08:24:29 CST; 26s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 58507 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS)
Process: 58426 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Main PID: 58511 (mysqld)
CGroup: /system.slice/mysqld.service
└─58511 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/my…
7月 30 08:24:21 localhost.localdomain systemd[1]: Starting MySQL Server…
7月 30 08:24:29 localhost.localdomain systemd[1]: Started MySQL Server.(注意这句话,说明此时MySQL服务已经在运行)
下一篇: 支付宝接口调用