CentOS 6.5上安装MariaDB(三)

2015-03-05 23:52:21 · 作者: · 浏览: 92
? ? ? ? ? ? ? ? ?


Dependency Installed:
? MariaDB-common.x86_64 0:5.5.36-1.el6? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?


Replaced:
? mysql.x86_64 0:5.1.71-1.el6? ? ? ? ? ? ? ? ? ? ? ? ? mysql-libs.x86_64 0:5.1.71-1.el6? ? ? ? ? ? ? ? ? ? ? ? ?


Failed:
? MariaDB-server.x86_64 0:5.5.36-1.el6? ? ? ? ? ? ? ? ? ? mysql-server.x86_64 0:5.1.71-1.el6? ? ? ? ? ? ? ? ? ?


Complete!


3、启动MariaDB


# /etc/init.d/mysqld start
Initializing MySQL database:? WARNING: The host 'Cloud-Q2' could not be looked up with resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !
Installing MySQL system tables...
OK
Filling help tables...
OK


To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system


PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:


/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h Cloud-Q2 password 'new-password'


Alternatively you can run:
/usr/bin/mysql_secure_installation


which will also give you the option of removing the test
databases and anonymous user created by default.? This is
strongly recommended for production servers.


See the manual for more instructions.


You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &


You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl


Please report any problems with the /usr/bin/mysqlbug script!


? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [? OK? ]
Starting mysqld:? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [? OK? ]


4、为MariaDB设置密码


# /usr/bin/mysqladmin -u root password 'adminadmin'


登陆MariaDB


MySQL [(none)]> use mysql;
MySQL [mysql]> update user set host='%' where user='root' and host='127.0.0.1';
MySQL [mysql]> grant all privileges on *.* to 'root'@'%' identified by 'adminadmin' with grant option;
MySQL [mysql]> flush privileges;


5、让防火墙通过3306端口


# vi /etc/sysconfig/iptables


添加如下内容:


-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT


保存并退出编辑
重启防火墙服务


# service iptables restart


远程连接检查,一切OK!