在centos上安裝mysql5.5.31的安裝過程,
安裝之前請刪除已經安裝的mysql,方法請看[url]
在mysql官網下的是server和client的安裝檔案
mysql-server-5.5.31-2.linux2.6.x86_64.rpm
mysql-client-5.5.31-2.linux2.6.x86_64.rpm
linux下的安裝命令
rpm -ivh mysql-server-5.5.31-2.linux2.6.x86_64.rpm mysql-client-5.5.31-2.linux2.6.x86_64.rpm
提示安裝完成後,輸入mysql 看是否安裝成功
mysql
# mysql
error 2002 (hy000): can't connect to local mysql server through socket '/var/lib/mysql/mysql.sock' (2)
# service mysql start
starting mysql.. success!
# # mysql
welcome to the mysql monitor. commands end with ; or \g.
your mysql connection id is 1
server version: 5.5.31 mysql community server (gpl)
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>
首次安裝時,預設密碼為空,可以使用如下命令修改root密碼,
# mysqladmin -u root password 123456
# mysql -u root -p
rpm包安裝的mysql是不會安裝/etc/my.cnf檔案的,解決方法,只需要複製/usr/share/mysql目錄下的my-huge.cnf 檔案到/etc目錄,並改名為my.cnf即可
cp /usr/share/mysql/my-huge.cnf /etc/my.cnf
配置遠端訪問
處於安全考慮,mysql預設是不允許遠端訪問的,可以使用下面開啟遠端訪問
//賦予任何主機訪問資料的許可權
mysql>grant all privileges on *.* to 'root'@'%'with grant option;
//使修改生效
mysql>flush privileges;
如果依然不能遠端訪問的話,那就很可能防火牆的原因了,可以在防火牆中開啟3306埠或者乾脆關掉防火牆。
Linux下MySQL的安裝
mysql資料庫的安裝 1 安裝依賴包 yum install gcc gcc c autoconf bison automake zlib fiex libxml ncurses devel libmcrypt libtool ltdl devel y 2 安裝cmake cd tmp wget ...
linux下mysql的安裝
系統 centos6.5 64bits 安裝包 mysql 5.5.53 1.el6.x86 64.rpm bundle.tar 1 將mysql 5.5.53 1.el6.x86 64.rpm bundle.tar複製到linux opt目錄下,2 解壓mysql 5.5.53 1.el6.x86...
linux下mysql的安裝
執行命令 tar mysql 5.6.17 linux glibc2.5 i686.tar.gz 執行命令 cp mysql 5.6.17 linux glibc2.5 i686 usr local mysql r 執行命令 groupadd mysql和useradd r g mysql mysq...