如何在fedora23上安装和运行MySQL server (MySQL 已经被MariaDB取代)

安装及配置

[root@localhost kemin]# dnf install mysql-server
Fedora 23 - x86_64 - Updates                                                                                  1.4 MB/s |  15 MB     00:11    
Last metadata expiration check performed 0:00:04 ago on Fri Dec 25 18:36:32 2015.
Dependencies resolved.
==============================================================================================================================================
 Package                               Arch                        Version                                 Repository                    Size
==============================================================================================================================================
Installing:
 mariadb-errmsg                        x86_64                      1:10.0.21-1.fc23                        updates                      199 k
 mariadb-libs                          x86_64                      1:10.0.21-1.fc23                        updates                      637 k
 mariadb-server                        x86_64                      1:10.0.21-1.fc23                        updates                       18 M
 perl-DBD-MySQL                        x86_64                      4.033-1.fc23                            updates                      153 k
 perl-DBI                              x86_64                      1.633-6.fc23                            fedora                       727 k
 perl-Math-BigInt                      noarch                      1.9997-350.fc23                         updates                      188 k

Transaction Summary
==============================================================================================================================================
Install  6 Packages

Total download size: 20 M
Installed size: 94 M
Is this ok [y/N]: y
Downloading Packages:
(1/6): mariadb-errmsg-10.0.21-1.fc23.x86_64.rpm                                                               134 kB/s | 199 kB     00:01    
(2/6): perl-DBD-MySQL-4.033-1.fc23.x86_64.rpm                                                                 145 kB/s | 153 kB     00:01    
(3/6): perl-DBI-1.633-6.fc23.x86_64.rpm                                                                       212 kB/s | 727 kB     00:03    
[MIRROR] perl-Math-BigInt-1.9997-350.fc23.noarch.rpm: Curl error (28): Timeout was reached for ftp://mirrors.ustc.edu.cn/fedora/linux/updates/23/x86_64/p/perl-Math-BigInt-1.9997-350.fc23.noarch.rpm []
(4/6): mariadb-libs-10.0.21-1.fc23.x86_64.rpm                                                                 438 kB/s | 637 kB     00:01    
(5/6): perl-Math-BigInt-1.9997-350.fc23.noarch.rpm                                                            243 kB/s | 188 kB     00:00    
(6/6): mariadb-server-10.0.21-1.fc23.x86_64.rpm                                                               1.3 MB/s |  18 MB     00:14    
----------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                         1.2 MB/s |  20 MB     00:17     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Installing  : perl-Math-BigInt-1.9997-350.fc23.noarch                                                                                   1/6 
  Installing  : perl-DBI-1.633-6.fc23.x86_64                                                                                              2/6 
  Installing  : mariadb-libs-1:10.0.21-1.fc23.x86_64                                                                                      3/6 
  Installing  : perl-DBD-MySQL-4.033-1.fc23.x86_64                                                                                        4/6 
  Installing  : mariadb-errmsg-1:10.0.21-1.fc23.x86_64                                                                                    5/6 
  Installing  : mariadb-server-1:10.0.21-1.fc23.x86_64                                                                                    6/6 
  Verifying   : mariadb-server-1:10.0.21-1.fc23.x86_64                                                                                    1/6 
  Verifying   : perl-DBI-1.633-6.fc23.x86_64                                                                                              2/6 
  Verifying   : mariadb-errmsg-1:10.0.21-1.fc23.x86_64                                                                                    3/6 
  Verifying   : perl-DBD-MySQL-4.033-1.fc23.x86_64                                                                                        4/6 
  Verifying   : mariadb-libs-1:10.0.21-1.fc23.x86_64                                                                                      5/6 
  Verifying   : perl-Math-BigInt-1.9997-350.fc23.noarch                                                                                   6/6 

Installed:
  mariadb-errmsg.x86_64 1:10.0.21-1.fc23         mariadb-libs.x86_64 1:10.0.21-1.fc23         mariadb-server.x86_64 1:10.0.21-1.fc23         
  perl-DBD-MySQL.x86_64 4.033-1.fc23             perl-DBI.x86_64 1.633-6.fc23                 perl-Math-BigInt.noarch 1.9997-350.fc23        

Complete!

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

[root@localhost kemin]# systemctl start mariadb.service
[root@localhost kemin]# systemctl enable mariadb.service
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
            
[root@localhost kemin]# mysql_secure_installation 

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): 
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] Y
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!
[root@localhost kemin]# 

参考

https://ask.fedoraproject.org/en/question/43459/how-to-start-mysql-mysql-isnt-starting/

http://fedoraproject.org/wiki/Features/ReplaceMySQLwithMariaDB





你可能感兴趣的:(应用开发)