1.這裡我將mysql安裝在/usr/local/mysql目錄裡面,也可以安裝在其他地方
mkdir /usr/local/mysql
[html]
view plain
copy
wget
3.解壓並複製
[html]
view plain
copy
tar -xvf mysql-5.7.11-linux-glibc2.5-x86_64.tar.gz
mv mysql-5.7.11-linux-glibc2.5-x86_64 /usr/local/mysql/
4.建立data目錄
[html]
view plain
copy
mkdir /usr/local/mysql/data
5.建立mysql使用者和修改許可權
[html]
view plain
copy
groupadd mysql
chown -r mysql.mysql /usr/local/mysql/
6.初始化資料
[html]
view plain
copy
[root@localhost mysql] ./bin/mysqld --initialize
--user
=mysql
--basedir
=/usr/local/mysql/
--datadir
=/usr/local/mysql/data/
2016-01-20 02:47:35 [warning] mysql_install_db is deprecated. please consider switching to mysqld --initialize
2016-01-20 02:47:45 [warning] the bootstrap log isn't empty:
2016-01-20 02:47:45 [warning] 2016-01-19t18:47:36.732678z 0 [warning] --bootstrap is deprecated. please consider using --initialize instead
2016-01-19t18:47:36.750527z 0 [warning] changed limits: max_open_files: 1024 (requested 5000)
2016-01-19t18:47:36.750560z 0 [warning] changed limits: table_open_cache: 431 (requested 2000)
7. 複製配置檔案到 /etc/my.cnf
[html]
view plain
copy
cp -a ./support-files/my-default.cnf /etc/my.cnf (選擇y)
8. mysql的服務指令碼放到系統服務中
[html]
view plain
copy
cp -a ./support-files/mysql.server /etc/init.d/mysqld
修改my.cnf檔案
9.啟動mysql
[html]
view plain
copy
service mysqld start
10.修改mysql密碼
[sql]
view plain
copy
[root@localhost mysql]# mysql -u root mysql
mysql>update
user
setauthentication_string=
password
('你的密碼'
10.建立快捷方式
[html]
view plain
copy
ln -s /usr/local/mysql/bin/mysql /usr/bin
Linux MySql 5 7 安裝與開啟遠端訪問
安裝 安裝 dos下 mysql 客戶端訪問軟體 sudo apt install mysql client core 5.7 安裝 mysql server sudo apt install mysql server dos登入mysql mysql u root p 回車 root 修改登入密碼...
Linux mysql5 7中的中文字元報錯問題
今天想用在mysql中插入資料,但是報這個錯誤 1366,incorrect string value xe5 x8d x971 for column cbuilding at row 1 解決方法 檢視你的資料庫 該錶以及該列的編碼格式 若是你在建立表的時候沒有設定預設編碼格式為utf8的話,他會...
Linux MySQL5 7 yum方式安裝
進入編輯 vi etc sysconfig selinux vim編輯,開啟這行 selinux disabled 重啟操作 reboot 然後通過 ssh重新登陸 ssh root 10.110 1621 檢視是否禁用成功 getenforce使用 163 映象源 替換yum源 更新快取 yum ...