JavaShuo
欄目
標籤
centos 7 yum 安裝 mysql glib 安裝 mysql
時間 2019-11-18
標籤
centos
yum
安裝
mysql
glib
欄目
CentOS
简体版
原文
原文鏈接
centos 7 YUM 在線安裝版
1.wget
http://repo.mysql.com/mysql57-community-release-el7-10.noarch.rpm
下載
2.rpm -Uvh mysql57-community-release-el7-10.noarch.rpm 安裝rpm源
3.yum install -y mysql-community-server 取決於網速
4.systemctl start mysqld.service / service mysqld start 啓動mysql
5.service mysqld status 查看啓動狀態
6.
7.grep 'temporary password' /var/log/mysqld.log 查看mysql臨時密碼
8.mysql -uroot -p 登陸mysql
9.ALTER USER 'root'@'localhost' IDENTIFIED BY 'root';
修改密碼-> 提示: ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
10. set global validate_password_policy=0;
11. set global validate_password_length=1; 重複9步驟--->修改密碼
12.GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'yourpassword' WITH GRANT OPTION; 開放遠程登陸
FLUSH PRIVILEGES; 刷新配置
13.關閉防火牆
查看防火牆 systemctl status firewalld.service / service iptables status status/start/restart/stop --option
14.修改配置文件
vi /etc/my.cnf 編輯my.cnf / 沒有手動建立文件
正確配置
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
[mysqld]
character_set_server=utf8
#[client]
#default-character-set=utf8
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
15.systemctl status mysqld.service 查看mysql 狀態 status/start/stop/restart -- option
Centos glib版安裝
1.tar -zvxf mysql-5.7.26-linux-glibc2.12-x86_64.tar.gz 解壓
2.mv mysql-5.7.26-linux-glibc2.12-x86_64/* /usr/local/mysql 移動文件
3.groupadd user 添加用戶
4.useradd -r -g mysql mysql 添加用戶組
5.rpm -qa | grep libaio 檢查libaio
6.
yum -y install libaio
安裝libaio
7.vi /etc/my.cnf 編輯my.cnf / 沒有手動建立文件
[mysql]
# 設置mysql客戶端默認字符集
default-character-set=utf8
socket=/var/lib/mysql/mysql.sock
[mysqld]
#skip-name-resolve
#設置3306端口
port = 3306
socket=/var/lib/mysql/mysql.sock
# 設置mysql的安裝目錄
basedir=/usr/local/mysql
# 設置mysql數據庫的數據的存放目錄
datadir=/usr/local/mysql/data
# 容許最大鏈接數
max_connections=200
# 服務端使用的字符集默認爲8比特編碼的latin1字符集
character-set-server=utf8
# 建立新表時將使用的默認存儲引擎
#default-storage-engine=MyIsam
default-storage-engine=INNODB
#lower_case_table_name=1
max_allowed_packet=16M
8.mkdir data 建立目錄
9.[root@localhost mysql]# chown -R mysql:mysql ./ 受權目錄擁有者
10.[root@localhost mysql]# ./bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/ 初始化
11.成功圖示
12.[root@localhost mysql]# cp ./support-files/mysql.server /etc/rc.d/init.d/mysqld
13.增長 mysqld 服務控制腳本執行權限:[root@localhost mysql]# chmod +x /etc/rc.d/init.d/mysqld
14.將 mysqld 服務加入到系統服務:[root@localhost mysql]# chkconfig --add mysqld
15.檢查mysqld服務是否已經生效:[root@localhost mysql]# chkconfig --list mysqld
16.[root@localhost mysql]# service mysqld start 啓動mysql 提示 err目錄 pid不存在
Starting MySQL.Logging to '/usr/local/mysql/data/localhost.localdomain.err'.
2019-07-04T02:40:27.646818Z mysqld_safe Directory '/var/lib/mysql' for UNIX socket file don't exists.
ERROR! The server quit without updating PID file (/usr/local/mysql/data/localhost.localdomain.pid).
17.[root@localhost mysql]# mkdir /var/lib/mysql
[root@localhost mysql]# chown -R mysql /var/lib/mysql
18.再次啓動
19.登陸 提示command
20.進行軟連接
ln -s /usr/local/mysql/bin/mysql /usr/bin
21.
22.先進行密碼設置 ,
SET PASSWORD = PASSWORD('123456'); 設置初始密碼。 否則操做不了數據庫
23.提示 You must reset your password using ALTER USER statement before executing this statement.
24
25.use mysql 切到系統庫
26.mysql> grant all privileges on *.* to root@"%" identified by "123456" with grant option; 受權遠程登陸
Query OK, 0 rows affected, 1 warning (0.00 sec)
27.mysql> flush privileges; 刷新
Query OK, 0 rows affected (0.00 sec)
28. systemctl status mysqld.service mysql 狀態
29.systemctl status firewalld.service 關閉防火牆
30.
完畢。整理OK。親測可用。注意以上安裝都沒有配置環境變量。虛擬學習而已
補充:
html
相關文章
1.
CentOS 7 yum 安裝 MySQL
2.
CentOS 7 用yum安裝 MySQL
3.
centos yum MySQL安裝
4.
centos yum 安裝mysql
5.
CentOS 7 安裝 MySQL
6.
CentOS 7安裝MySQL
7.
CentOS 7 安裝 Mysql
8.
CentOS 7安裝Mysql
9.
centos 7安裝 mysql
10.
centos 7 安裝 MySql
更多相關文章...
•
CentOS Docker 安裝
-
Docker教程
•
Docker 安裝 MySQL
-
Docker教程
•
Composer 安裝與使用
•
IntelliJ IDEA安裝代碼格式化插件
相關標籤/搜索
yum安裝
安裝
mysql 安裝教程
MySQL基礎 安裝
yum安裝方式
yum在線安裝
PyCharm的安裝
工具安裝
ROS安裝
環境安裝
Unix
MySQL
CentOS
MySQL教程
PHP 7 新特性
Hibernate教程
mysql
0
分享到微博
分享到微信
分享到QQ
每日一句
每一个你不满意的现在,都有一个你没有努力的曾经。
最新文章
1.
字節跳動21屆秋招運營兩輪面試經驗分享
2.
Java 3 年,25K 多嗎?
3.
mysql安裝部署
4.
web前端開發中父鏈和子鏈方式實現通信
5.
3.1.6 spark體系之分佈式計算-scala編程-scala中trait特性
6.
dataframe2
7.
ThinkFree在線
8.
在線畫圖
9.
devtools熱部署
10.
編譯和鏈接
本站公眾號
歡迎關注本站公眾號,獲取更多信息
相關文章
1.
CentOS 7 yum 安裝 MySQL
2.
CentOS 7 用yum安裝 MySQL
3.
centos yum MySQL安裝
4.
centos yum 安裝mysql
5.
CentOS 7 安裝 MySQL
6.
CentOS 7安裝MySQL
7.
CentOS 7 安裝 Mysql
8.
CentOS 7安裝Mysql
9.
centos 7安裝 mysql
10.
centos 7 安裝 MySql
>>更多相關文章<<