视频1 视频21 视频41 视频61 视频文章1 视频文章21 视频文章41 视频文章61 推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37 推荐39 推荐41 推荐43 推荐45 推荐47 推荐49 关键词1 关键词101 关键词201 关键词301 关键词401 关键词501 关键词601 关键词701 关键词801 关键词901 关键词1001 关键词1101 关键词1201 关键词1301 关键词1401 关键词1501 关键词1601 关键词1701 关键词1801 关键词1901 视频扩展1 视频扩展6 视频扩展11 视频扩展16 文章1 文章201 文章401 文章601 文章801 文章1001 资讯1 资讯501 资讯1001 资讯1501 标签1 标签501 标签1001 关键词1 关键词501 关键词1001 关键词1501 专题2001
CentOS6.5上安装MariaDB
2020-11-09 07:34:38 责编:小采
文档


CentOS 6.5上安装MariaDB 作者:chszs,转载需注明。博客主页:http://blog.csdn.net/chszs 1、软件环境: CentOS 6.5 x 2、安装过程 1)在/etc/yum.repos.d/目录创建MariaDB.repo文件,内容如下: # MariaDB 5.5 CentOS repository list - created 2014-0

CentOS 6.5上安装MariaDB

作者:chszs,转载需注明。博客主页:http://blog.csdn.net/chszs
1、软件环境: CentOS 6.5 x
2、安装过程 1)在/etc/yum.repos.d/目录创建MariaDB.repo文件,内容如下:
# MariaDB 5.5 CentOS repository list - created 2014-03-04 11:20 UTC # http://mariadb.org/mariadb/repositories/ [mariadb] name = MariaDB baseurl = http://yum.mariadb.org/5.5/centos6-amd gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1
# yum install MariaDB-server MariaDB-client Loaded plugins: fastestmirror, security base | 3.7 kB 00:00 base/primary_db | 4.4 MB 01:11 extras | 3.4 kB 00:00 extras/primary_db | 19 kB 00:00 mariadb | 1.9 kB 00:00 mariadb/primary_db | 15 kB 00:00 updates | 3.4 kB 00:00 updates/primary_db | 2.1 MB 00:22 Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package MariaDB-client.x86_ 0:5.5.36-1.el6 will be obsoleting --> Processing Dependency: MariaDB-common for package: MariaDB-client-5.5.36-1.el6.x86_ ---> Package MariaDB-server.x86_ 0:5.5.36-1.el6 will be obsoleting ---> Package mysql.x86_ 0:5.1.71-1.el6 will be obsoleted ---> Package mysql-server.x86_ 0:5.1.71-1.el6 will be obsoleted --> Running transaction check ---> Package MariaDB-common.x86_ 0:5.5.36-1.el6 will be installed --> Processing Dependency: MariaDB-compat for package: MariaDB-common-5.5.36-1.el6.x86_ --> Running transaction check ---> Package MariaDB-compat.x86_ 0:5.5.36-1.el6 will be obsoleting ---> Package mysql-libs.x86_ 0:5.1.71-1.el6 will be obsoleted --> Finished Dependency Resolution Dependencies Resolved ================================================================================================================== Package Arch Version Repository Size ================================================================================================================== Installing: MariaDB-client x86_ 5.5.36-1.el6 mariadb 10 M replacing mysql.x86_ 5.1.71-1.el6 MariaDB-compat x86_ 5.5.36-1.el6 mariadb 2.7 M replacing mysql-libs.x86_ 5.1.71-1.el6 MariaDB-server x86_ 5.5.36-1.el6 mariadb 42 M replacing mysql-server.x86_ 5.1.71-1.el6 Installing for dependencies: MariaDB-common x86_ 5.5.36-1.el6 mariadb 23 k Transaction Summary ================================================================================================================== Install 4 Package(s) Total download size: 55 M Is this ok [y/N]: y Downloading Packages: (1/4): MariaDB-5.5.36-centos6-x86_-client.rpm | 10 MB 04:45 (2/4): MariaDB-5.5.36-centos6-x86_-common.rpm | 23 kB 00:00 (3/4): MariaDB-5.5.36-centos6-x86_-compat.rpm | 2.7 MB 01:02 (4/4): MariaDB-5.5.36-centos6-x86_-server.rpm | 42 MB 17:44 ------------------------------------------------------------------------------------------------------------------ Total 40 kB/s | 55 MB 23:34 warning: rpmts_HdrFromFdno: Header V4 DSA/SHA1 Signature, key ID 1bb943db: NOKEY Retrieving key from https://yum.mariadb.org/RPM-GPG-KEY-MariaDB Importing GPG key 0x1BB943DB: Userid: "Daniel Bartholomew (Monty Program signing key) " From : https://yum.mariadb.org/RPM-GPG-KEY-MariaDB Is this ok [y/N]: y Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : MariaDB-compat-5.5.36-1.el6.x86_ 1/7 Installing : MariaDB-common-5.5.36-1.el6.x86_ 2/7 Error in PREIN scriptlet in rpm package MariaDB-server-5.5.36-1.el6.x86_ ****************************************************************** A MySQL or MariaDB server package (mysql-server-5.1.71-1.el6.x86_) is installed. The current MariaDB server package is provided by a different vendor (CentOS) than Monty Program AB. Some files may be installed to different locations, including log files and the service startup script in /etc/init.d/. Upgrading directly from MySQL 5.1 to MariaDB 5.5 may not be safe in all cases. A manual dump and restore using mysqldump is recommended. It is important to review the MariaDB manual's Upgrading section for version-specific incompatibilities. A manual upgrade is required. - Ensure that you have a complete, working backup of your data and my.cnf files - Shut down the MySQL server cleanly - Remove the existing MySQL packages. Usually this command will list the packages you should remove: rpm -qa | grep -i '^mysql-' You may choose to use 'rpm --nodeps -ev ' to remove the package which contains the mysqlclient shared library. The library will be reinstalled by the MariaDB-shared package. - Install the new MariaDB packages supplied by Monty Program AB - Ensure that the MariaDB server is started - Run the 'mysql_upgrade' program This is a brief description of the upgrade process. Important details can be found in the MariaDB manual, in the Upgrading section. ****************************************************************** error: %pre(MariaDB-server-5.5.36-1.el6.x86_) scriptlet failed, exit status 1 error: install: %pre scriptlet failed (2), skipping MariaDB-server-5.5.36-1.el6 Installing : MariaDB-client-5.5.36-1.el6.x86_ 4/7 Erasing : mysql-5.1.71-1.el6.x86_ 5/7 Erasing : mysql-libs-5.1.71-1.el6.x86_ 6/7 Verifying : MariaDB-common-5.5.36-1.el6.x86_ 1/7 Verifying : MariaDB-compat-5.5.36-1.el6.x86_ 2/7 Verifying : MariaDB-client-5.5.36-1.el6.x86_ 3/7 Verifying : mysql-libs-5.1.71-1.el6.x86_ 4/7 Verifying : MariaDB-server-5.5.36-1.el6.x86_ 5/7 mysql-server-5.1.71-1.el6.x86_ was supposed to be removed but is not! Verifying : mysql-server-5.1.71-1.el6.x86_ 6/7 Verifying : mysql-5.1.71-1.el6.x86_ 7/7 Installed: MariaDB-client.x86_ 0:5.5.36-1.el6 MariaDB-compat.x86_ 0:5.5.36-1.el6 Dependency Installed: MariaDB-common.x86_ 0:5.5.36-1.el6 Replaced: mysql.x86_ 0:5.1.71-1.el6 mysql-libs.x86_ 0:5.1.71-1.el6 Failed: MariaDB-server.x86_ 0:5.5.36-1.el6 mysql-server.x86_ 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'

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;
# vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
# service iptables restart

下载本文
显示全文
专题