標籤:iptables ide 規則 更改密碼 table blog 搜尋 res 使用者
下載mysql地址
http://dev.mysql.com/downloads/mysql/
選擇下面這個
查看是否存在mysql安裝包
rpm -qa|grep -i mysql
刪除mysql安裝包 --nodeps 忽略依賴關係
rpm -e --nodeps mysql-libs-5.1.61-4.el6.i686
安裝mysql服務端
rpm -ivh MySQL-server-5.5.50-1.el6.i686.rpm
安裝mysql用戶端
rpm -ivh MySQL-client-5.5.50-1.el6.i686.rpm
--------------------------------------------------------
配置mysql初始密碼
mysqladmin -uroot password root
mysqladmin -u root -p password 1234
如果以上配置出現一下錯誤
那麼用以下方法
[[email protected] mysql]# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
mysql> UPDATE user SET Password=PASSWORD(‘root‘) where USER=‘root‘;
mysql> FLUSH PRIVILEGES;
-------------------------------------------------------
mysql
登入進去之後更改密碼
set password=password(‘123‘);
加入到系統服務列表
chkconfig --add mysql
自動啟動
chkconfig mysql on
查看自動啟動列表
chkconfig
登入mysql
例如,你想root使用root密碼 從任何主機串連到mysql伺服器的話。
GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘IDENTIFIED BY ‘root‘ WITH GRANT OPTION;
如果你想允許使用者myuser從ip為192.168.1.6的主機串連到mysql伺服器,並使用mypassword作為密碼
GRANT ALL PRIVILEGES ON *.* TO ‘myuser‘@‘192.168.1.3‘IDENTIFIED BY
‘mypassword‘ WITH GRANT OPTION;
需要重新整理一下才會生效
FLUSH PRIVILEGES
切換到外部
開放3306連接埠
/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
儲存防火牆規則
/etc/rc.d/init.d/iptables save
重新整理防火牆規則
service iptables save
service iptables restart
以上兩個都行
查看連接埠開放情況
/etc/init.d/iptables status
ls | grep mysql 檔案搜尋
以上配置在centos6.3下,我將所有需要的依賴已經全部安裝,如果出現相關錯誤,請安裝相應的依賴lib檔案
【linux】之安裝mysql常用配置