mysql完整版 MYSQL安裝(完整版)

2021-10-18 22:17:31 字數 2225 閱讀 1841

一、完全解除安裝mysql

yum remove mysql mysql-server mysql-libs compat-mysql51

rm -rf /var/lib/mysql

rm /etc/my.cnf

#檢視是否還有mysql軟體:

rpm -qa|grep mysql

#如果存在的話,繼續刪除即可。

mysql-server(5.6)

mysql-client (5.6)

mysql-devel  (5.6)

三、安裝

rpm -ivh mysql-server-5.6.17-1.linux_glibc2.5.x86_64.rpm

rpm -ivh mysql-client-5.6.17-1.linux_glibc2.5.x86_64.rpm

rpm -ivh mysql-devel-5.6.17-1.linux_glibc2.5.x86_64.rpm

四、問題

error 1045 (28000): access denied for user 'mysql'@'localhost' (using password: no)?

第一步:修改資料庫預設密碼/etc/init.d/mysql stop   (service mysqld stop )/usr/bin/mysqld_safe --skip-grant-tables另外開個ssh連線[root@localhost ~]# mysqlmysql>use mysqlmysql>update user set password=password("123456") where user="root";mysql>flush privileges;mysql>exit第二步:[mysql@localhost etc]$ ps -a | grep mysql4532 pts/0    00:00:00 mysqld_safe5542 pts/0    00:00:00 mysqld[mysql@localhost etc]$ kill -9 4532 5542正常啟動 mysql:/etc/init.d/mysql start   (service mysql start)第三步:

[root@linux-ke bob]# mysql -u root -p

enter password:

welcome to the mysql monitor. commands end with ; or \g.

your mysql connection id is 2

server version: 5.6.17

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> exit;

bye第四步:

server version: 5.6.17

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> show databases;

error 1820 (hy000): you must set password before executing this statement

mysql> set password = password('123456');

query ok, 0 rows affected (0.00 sec)

mysql> show databases;

| database |

| information_schema |

| mysql |

| performance_schema |

| test |

4 rows in set (0.00 sec)

mysql>

完成

Docker 安裝 Mysql 容器 完整版

docker 映象倉庫 在docker映象倉庫尋找mysql映象 描述docker pull mysql docker pull mysql docker imagesdocker 建立mysql容器 docker run name mysql d p 3306 3306 restart unles...

LInux 安裝Mysql5 6 1 完整版

2.解壓mysql安裝檔案 3.複製解壓後的mysql目錄到系統的本地軟體目錄 4.新增系統mysql組和mysql使用者 5.安裝資料庫 1.進入安裝mysql軟體目錄 2.修改當前目錄擁有者為mysql使用者 3.安裝資料庫 4.修改當前目錄擁有者為root使用者 5.修改當前data目錄擁有者...

CentOS7安裝MySQL(完整版)

或者 3.安裝mysql伺服器。yum install mysql community server4.安裝mysql yum install mysql mysql server php mysql y service mysqld stop 2 檢視mysql狀態 service mysqld ...