您好,登錄后才能下訂單哦!
查看系統中安裝的rpm包
rpm -qa | grep mysql
卸載自帶的mysql
解壓mysql
mysql-community-common-5.7.18-1.el7.x86_64.rpm
mysql-community-libs-5.7.18-1.el7.x86_64.rpm(依賴于common)
mysql-community-client-5.7.18-1.el7.x86_64.rpm(依賴于libs)
mysql-community-server-5.7.18-1.el7.x86_64.rpm(依賴于common,client)
mysql-community-devel-5.7.18-1.el7.x86_64.rpm(MySQL頭文件和庫文件)
mysql-community-libs-compat-5.7.18-1.el7.x86_64.rpm
rpm -ivh mysql-community-common-5.7.18-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.18-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-5.7.18-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-5.7.18-1.el7.x86_64.rpm
rpm -ivh mysql-community-devel-5.7.18-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-compat-5.7.18-1.el7.x86_64.rpm
強制卸載
rpm -e --nodeps mariadb-libs-5.5.41-2.el7_0.x86_64
在文件尾部添加
character_set_server=utf8 --設置字符集
init_connect='SET NAMES utf8'
lower_case_table_names=1 --忽略大小寫
skip-grant-tables=1 --無密碼方式進入mysql
然后輸入 mysql -u root
use mysql;
update user set authentication_string = password('***'),
password_expired='N',password_last_changed = now() where user ='root'; FLUSH PRIVILEGES;
退出數據庫
exit
把添加的配置文件的一行刪掉,光標移動到最下面,按“i”鍵,刪除skip-grant-tables=1
mysql -u root -p**
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '**' WITH GRANT OPTION; --絕對不能少的一步;
CREATE DATABASE `**` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。