CentOS安装MySQL
官方安装文档
https://dev.mysql.com/doc/mysql-yum-repo-quick-guide/en/
-
添加MySQL Yum存储库
首先,将MySQL Yum存储库添加到系统的存储库列表中。跟着这些步骤:
- 访问https://dev.mysql.com/downloads/repo/yum/
- 选择并下载适用于您的平台的发行包。
- 下载到本地再上传到服务器,或者使用wget 直接下载
wget https://dev.mysql.com/get/mysql80-community-release-el7-2.noarch.rpm
- 将platform-and-version-specific-package-name 替换为你下载的rpm名
sudo rpm -Uvh platform-and-version-specific-package-name.rpm
例如
rpm -Uvh mysql80-community-release-el7-2.noarch.rpm
-
安装MySQL
通过以下命令安装MySQL
sudo yum install mysql-community-server
-
启动MySQL服务器
使用以下命令启动MySQL服务器:
sudo service mysqld start
您可以使用以下命令检查MySQL服务器的状态:
sudo service mysqld status
-
修改临时密码
从MySQL 5.7开始 ‘root’@’localhost 是有密码的 密码存储在错误日志文件中 要显示它,请使用以下命令:
sudo grep 'temporary password' /var/log/mysqld.log
使用临时密码登录并修改密码:
mysql -uroot -p
ALTER USER 'root'@'localhost' IDENTIFIED BY 'YourNewPass4!';
-
授权其他机器登录
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'YourPass4!' WITH GRANT OPTION;
FLUSH PRIVILEGES; - 冲突处理
rpm -qa|grep mariadb
rpm -e mariadb-libs-5.5.56-2.el7.x86_64 --nodeps
- http://repo.mysql.com/yum/mysql-8.0-community/el/7/x86_64/
- rpm -ivh
- yum install libnuma*
- mysqld –initialize –console
- chown -R mysql:mysql /var/lib/mysql/
2 条评论
sevenbites · 2019年2月7日 上午1:34
I believe everything posted made a great deal of sense.
But, think on this, suppose you were to create a awesome headline?
I am not saying your content isn’t good., but what if you added a headline to possibly get people’s
attention? I mean CentOS安装MySQL –
lemone is a little plain. You might look at Yahoo’s front page and note how
they create post headlines to get viewers to open the links.
You might try adding a video or a related pic or
two to get readers excited about what you’vegot to say.
Just my opinion, it would bring your websitre a little livelier.
http://oldehickorytaproom.com/ · 2019年2月17日 上午8:28
Thank you for the good writeup. It in fact was a amusement account
it. Look advanced to far added agreeable from
you! However, how can we communicate?