mysql各個版本html
官網下載地址mysql
http://dev.mysql.com/downloads/mysql/linux
各個版本安裝請看官方教程sql
http://dev.mysql.com/doc/refman/5.7/en/installing.htmlshell
請選擇本身安裝的版本windows
window zip安裝安全
若是你中途安裝有問題就remove掉mysql吧服務器
從新安裝吧spa
linux下mysql的安裝code
來看官方文檔吧
http://dev.mysql.com/doc/refman/5.7/en/linux-installation-rpm.html
初始密碼和修改密碼
A superuser account 'root'@'localhost'
is created. A password for the superuser is set and stored in the error log file. To reveal it, use the following command for RHEL, Oracle Linux, CentOS, and Fedora systems:
shell> sudo grep 'temporary password' /var/log/mysqld.log
Use the following command for SLES systems:
shell> sudo grep 'temporary password' /var/log/mysql/mysqld.log
The next step is to log in with the generated, temporary password and set a custom password for the superuser account:
shell> mysql -uroot -p
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';
這個也是官方 ,
在linux下面的mysql若是須要遠程訪問的話須要配置ip地址的
你想root使用password從任何主機鏈接到mysql服務器的話。
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION; |
若是你想容許用戶myuser從ip爲192.168.100.120的主機鏈接到mysql服務器,並使用mypassword做爲密碼
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.100.120' IDENTIFIED BY 'password’ WITH GRANT OPTION; |
若是你有什麼問題話 請留言吧