Centos上安装Mysql

来源:IT165收集  发布日期:2015-02-27 20:16:17

操作系统信息:

[vagrant@localhost ~]$ uname -a

Linux localhost.localdomain 2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 00:31:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux


1、sudo yum install Percona-Server-shared-55-5.5.37-rel35.0.el6.x86_64.rpm

[vagrant@localhost download]$ sudo yum install Percona-Server-shared-55-5.5.37-rel35.0.el6.x86_64.rpm

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

* base: ftp.riken.jp

* extras: ftp.riken.jp

* updates: ftp.riken.jp

Setting up Install Process

Examining Percona-Server-shared-55-5.5.37-rel35.0.el6.x86_64.rpm: Percona-Server-shared-55-5.5.37-rel35.0.el6.x86_64

Marking Percona-Server-shared-55-5.5.37-rel35.0.el6.x86_64.rpm to be installed

Resolving Dependencies

--> Running transaction check

---> Package Percona-Server-shared-55.x86_64 0:5.5.37-rel35.0.el6 will be installed

--> Processing Dependency: libcrypto.so.10(libcrypto.so.10)(64bit) for package: Percona-Server-shared-55-5.5.37-rel35.0.el6.x86_64

--> Processing Dependency: libssl.so.10(libssl.so.10)(64bit) for package: Percona-Server-shared-55-5.5.37-rel35.0.el6.x86_64

--> Running transaction check

---> Package openssl.x86_64 0:1.0.0-27.el6_4.2 will be updated

--> Processing Dependency: openssl = 1.0.0-27.el6_4.2 for package: openssl-devel-1.0.0-27.el6_4.2.x86_64

---> Package openssl.x86_64 0:1.0.1e-30.el6_6.5 will be an update

--> Running transaction check

---> Package openssl-devel.x86_64 0:1.0.0-27.el6_4.2 will be updated

---> Package openssl-devel.x86_64 0:1.0.1e-30.el6_6.5 will be an update

--> Finished Dependency Resolution


Dependencies Resolved


==============================================================================================================

Package Arch Version Repository Size

==============================================================================================================

Installing:

Percona-Server-shared-55 x86_64 5.5.37-rel35.0.el6 /Percona-Server-shared-55-5.5.37-rel35.0.el6.x86_64 3.0 M

Updating for dependencies:

openssl x86_64 1.0.1e-30.el6_6.5 updates 1.5 M

openssl-devel x86_64 1.0.1e-30.el6_6.5 updates 1.2 M


Transaction Summary

==============================================================================================================

Install 1 Package(s)

Upgrade 2 Package(s)


Total size: 5.6 M

Total download size: 2.7 M

Is this ok [y/N]: y

Downloading Packages:

(1/2): openssl-1.0.1e-30.el6_6.5.x86_64.rpm | 1.5 MB 00:05

(2/2): openssl-devel-1.0.1e-30.el6_6.5.x86_64.rpm | 1.2 MB 00:06

--------------------------------------------------------------------------------------------------------------

Total 225 kB/s | 2.7 MB 00:12

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

Updating : openssl-1.0.1e-30.el6_6.5.x86_64 1/5

Installing : Percona-Server-shared-55-5.5.37-rel35.0.el6.x86_64 2/5

Updating : openssl-devel-1.0.1e-30.el6_6.5.x86_64 3/5

Cleanup : openssl-devel-1.0.0-27.el6_4.2.x86_64 4/5

Cleanup : openssl-1.0.0-27.el6_4.2.x86_64 5/5

Verifying : openssl-1.0.1e-30.el6_6.5.x86_64 1/5

Verifying : Percona-Server-shared-55-5.5.37-rel35.0.el6.x86_64 2/5

Verifying : openssl-devel-1.0.1e-30.el6_6.5.x86_64 3/5

Verifying : openssl-devel-1.0.0-27.el6_4.2.x86_64 4/5

Verifying : openssl-1.0.0-27.el6_4.2.x86_64 5/5


Installed:

Percona-Server-shared-55.x86_64 0:5.5.37-rel35.0.el6


Dependency Updated:

openssl.x86_64 0:1.0.1e-30.el6_6.5 openssl-devel.x86_64 0:1.0.1e-30.el6_6.5


Complete!


2、sudo yum install Percona-Server-devel-55-5.5.37-rel35.0.el6.x86_64.rpm

[vagrant@localhost download]$ sudo yum install Percona-Server-devel-55-5.5.37-rel35.0.el6.x86_64.rpm

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

* base: ftp.riken.jp

* extras: ftp.riken.jp

* updates: ftp.riken.jp

Setting up Install Process

Examining Percona-Server-devel-55-5.5.37-rel35.0.el6.x86_64.rpm: Percona-Server-devel-55-5.5.37-rel35.0.el6.x86_64

Marking Percona-Server-devel-55-5.5.37-rel35.0.el6.x86_64.rpm to be installed

Resolving Dependencies

--> Running transaction check

---> Package Percona-Server-devel-55.x86_64 0:5.5.37-rel35.0.el6 will be installed

--> Finished Dependency Resolution


Dependencies Resolved


==============================================================================================================

Package Arch Version Repository Size

==============================================================================================================

Installing:

Percona-Server-devel-55 x86_64 5.5.37-rel35.0.el6 /Percona-Server-devel-55-5.5.37-rel35.0.el6.x86_64 4.4 M


Transaction Summary

==============================================================================================================

Install 1 Package(s)


Total size: 4.4 M

Installed size: 4.4 M

Is this ok [y/N]: y

Downloading Packages:

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

Installing : Percona-Server-devel-55-5.5.37-rel35.0.el6.x86_64 1/1

Verifying : Percona-Server-devel-55-5.5.37-rel35.0.el6.x86_64 1/1


Installed:

Percona-Server-devel-55.x86_64 0:5.5.37-rel35.0.el6



3、sudo yum install Percona-Server-client-55-5.5.37-rel35.0.el6.x86_64.rpm

[vagrant@localhost download]$ sudo yum install Percona-Server-client-55-5.5.37-rel35.0.el6.x86_64.rpm

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

* base: ftp.riken.jp

* extras: ftp.riken.jp

* updates: ftp.riken.jp

Setting up Install Process

Examining Percona-Server-client-55-5.5.37-rel35.0.el6.x86_64.rpm: Percona-Server-client-55-5.5.37-rel35.0.el6.x86_64

Marking Percona-Server-client-55-5.5.37-rel35.0.el6.x86_64.rpm to be installed

Resolving Dependencies

--> Running transaction check

---> Package Percona-Server-client-55.x86_64 0:5.5.37-rel35.0.el6 will be installed

--> Finished Dependency Resolution


Dependencies Resolved


==============================================================================================================

Package Arch Version Repository Size

==============================================================================================================

Installing:

Percona-Server-client-55 x86_64 5.5.37-rel35.0.el6 /Percona-Server-client-55-5.5.37-rel35.0.el6.x86_64 29 M


Transaction Summary

==============================================================================================================

Install 1 Package(s)


Total size: 29 M

Installed size: 29 M

Is this ok [y/N]: y

Downloading Packages:

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

Installing : Percona-Server-client-55-5.5.37-rel35.0.el6.x86_64 1/1

Verifying : Percona-Server-client-55-5.5.37-rel35.0.el6.x86_64 1/1


Installed:

Percona-Server-client-55.x86_64 0:5.5.37-rel35.0.el6


Complete!


4、sudo yum install Percona-Server-server-55-5.5.37-rel35.0.el6.x86_64.rpm

[vagrant@localhost download]$ sudo yum install Percona-Server-server-55-5.5.37-rel35.0.el6.x86_64.rpm

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

* base: ftp.riken.jp

* extras: ftp.riken.jp

* updates: ftp.riken.jp

Setting up Install Process

Examining Percona-Server-server-55-5.5.37-rel35.0.el6.x86_64.rpm: Percona-Server-server-55-5.5.37-rel35.0.el6.x86_64

Marking Percona-Server-server-55-5.5.37-rel35.0.el6.x86_64.rpm to be installed

Resolving Dependencies

--> Running transaction check

---> Package Percona-Server-server-55.x86_64 0:5.5.37-rel35.0.el6 will be installed

--> Finished Dependency Resolution


Dependencies Resolved


==============================================================================================================

Package Arch Version Repository Size

==============================================================================================================

Installing:

Percona-Server-server-55 x86_64 5.5.37-rel35.0.el6 /Percona-Server-server-55-5.5.37-rel35.0.el6.x86_64 65 M


Transaction Summary

==============================================================================================================

Install 1 Package(s)


Total size: 65 M

Installed size: 65 M

Is this ok [y/N]: y

Downloading Packages:

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

Installing : Percona-Server-server-55-5.5.37-rel35.0.el6.x86_64 1/1

Error in my_thread_global_end(): 1 threads didn't exit

Error in my_thread_global_end(): 1 threads didn't exit


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 localhost.localdomain 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.


Please report any problems at

https://bugs.launchpad.net/percona-server/+filebug


Percona recommends that all production deployments be protected with a support

contract (http://www.percona.com/mysql-suppport/) to ensure the highest uptime,

be eligible for hot fixes, and boost your team's productivity.

Percona Server is distributed with several useful UDF (User Defined Function) from Percona Toolkit.

Run the following commands to create these functions:

mysql -e "CREATE FUNCTION fnv1a_64 RETURNS INTEGER SONAME 'libfnv1a_udf.so'"

mysql -e "CREATE FUNCTION fnv_64 RETURNS INTEGER SONAME 'libfnv_udf.so'"

mysql -e "CREATE FUNCTION murmur_hash RETURNS INTEGER SONAME 'libmurmur_udf.so'"

See http://www.percona.com/doc/percona-server/5.5/management/udf_percona_toolkit.html for more details

Verifying : Percona-Server-server-55-5.5.37-rel35.0.el6.x86_64 1/1


Installed:

Percona-Server-server-55.x86_64 0:5.5.37-rel35.0.el6


Complete!


5、启动mysql

[vagrant@localhost download]$ chkconfig --list | grep mysql

mysql 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭

[vagrant@localhost download]$ sudo service mysql start

Starting MySQL (Percona Server)..... SUCCESS!

[vagrant@localhost download]$ sudo netstat -ntlp | grep mysql

tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 2768/mysqld

6、创建mysql 用户

非root创建失败。

[vagrant@localhost ~]$ mysql

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 2

Server version: 5.5.37-35.0 Percona Server (GPL), Release rel35.0, Revision 657


Copyright (c) 2009-2014 Percona LLC and/or its affiliates

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.


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> CREATE USER dummy IDENTIFIED BY '123';

ERROR 1227 (42000): Access denied; you need (at least one of) the CREATE USER privilege(s) for this operation

root权限创建成功。

[vagrant@localhost ~]$ sudo mysql

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 3

Server version: 5.5.37-35.0 Percona Server (GPL), Release rel35.0, Revision 657


Copyright (c) 2009-2014 Percona LLC and/or its affiliates

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.


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> CREATE USER dummy IDENTIFIED BY '123';

Query OK, 0 rows affected (0.03 sec)


mysql> GRANT ALL ON *.* TO dummy;

Query OK, 0 rows affected (0.01 sec)

7、用新增用户登录mysql

[vagrant@localhost ~]$ sudo mysql -udummy -p

Enter password:

ERROR 1045 (28000): Access denied for user 'dummy'@'localhost' (using password: YES)

晕。。。。。。新增用户无法登录数据库。。。。。

原因暂时未找到。。。

继续用默认的root的账号。

Tag标签: Centos上安装Mysql  
  • 专题推荐

About IT165 - 广告服务 - 隐私声明 - 版权申明 - 免责条款 - 网站地图 - 网友投稿 - 联系方式
本站内容来自于互联网,仅供用于网络技术学习,学习中请遵循相关法律法规