安装依靠
yuminstalllibaiowget-y
查抄MYSQL是否已安装、
yumlistinstalled|grepmysql
假如有先卸载
-yremovemysql-libs.x86_64
下载MySQL官网的堆栈文件
cd/tmp
wgethttp://repo.mysql.com/mysql80-community-release-el7-1.noarch.rpm
yumlocalinstallmysql80-community-release-el7-1.noarch.rpm
验证堆栈是否添加乐成
yumrepolistenabled|grep"mysql.*-community.*"
安装MySQL
yuminstallmysql-community-server-y
此时MySQL安装完成,它包罗了
mysql-community-server、mysql-community-client
mysql-community-common、mysql-community-libs四个包
实行
rpm-qimysql-community-server.x86_640:8.0.16-2.el7
whereismysql
可以看到MySQL的安装目次是/usr/bin/
启动服务
systemctlstartmysqld
systemctlenablemysqld
systemctlstatusmysqld
查找初始暗码
cat/var/log/mysqld.log|greppassword
这里可以看到初始暗码
进入mysql
mysql-uroot-p
修改初始暗码
mysqlALTERUSER'root'@'localhost'IDENTIFIEDBY'你的暗码';
设置答应长途毗连
mysqlusemysql;
mysqlselecthost,user,authentication_string,pluginfromuser;
mysqlupdateusersethost='%'whereuser='root';
mysqlflushprivileges;
查察字符编码
mysqlstatus
假如是【utf8mb4】那就不消改了
接下来就可以通过navicat举行毗连了
我要评论