Installing MySQL on Linux using yum (Red Hat Linux, Fedora, CentOS)

MySQL  possesses one of the most advanced and comprehensive set of tools and libraries necessary to set up a database. Use the yum command to install the MySQL libraries required to provide for separate environments and languages

$ yum install mysql mysql-server mysql-libs mysql-server
Loaded plugins: presto, refresh-packagekit
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package mysql.x86_64 0:5.1.48-2.fc13 set to be updated
---> Package mysql-libs.x86_64 0:5.1.48-2.fc13 set to be updated
---> Package mysql-server.x86_64 0:5.1.48-2.fc13 set to be updated
--> Processing Dependency: perl-DBD-MySQL for package: mysql-server-5.1.48-2.fc13.x86_64
--> Running transaction check
---> Package perl-DBD-MySQL.x86_64 0:4.017-1.fc13 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
Package Arch Version Repository Size
mysql x86_64 5.1.48-2.fc13 updates 889 k
mysql-libs x86_64 5.1.48-2.fc13 updates 1.2 M
mysql-server x86_64 5.1.48-2.fc13 updates 8.1 M
Installing for dependencies:
perl-DBD-MySQL x86_64 4.017-1.fc13 updates 136 k
Transaction Summary
Install 4 Package(s)
Upgrade 0 Package(s)
Total download size: 10 M
Installed size: 30 M
Is this ok [y/N]: y
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 10 M
(1/4): mysql-5.1.48-2.fc13.x86_64.rpm | 889 kB 00:04
(2/4): mysql-libs-5.1.48-2.fc13.x86_64.rpm | 1.2 MB 00:06
(3/4): mysql-server-5.1.48-2.fc13.x86_64.rpm | 8.1 MB 00:40
(4/4): perl-DBD-MySQL-4.017-1.fc13.x86_64.rpm | 136 kB 00:00
Total 201 kB/s | 10 MB 00:52
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : mysql-libs-5.1.48-2.fc13.x86_64 1/4
Installing : mysql-5.1.48-2.fc13.x86_64 2/4
Installing : perl-DBD-MySQL-4.017-1.fc13.x86_64 3/4
Installing : mysql-server-5.1.48-2.fc13.x86_64 4/4
mysql.x86_64 0:5.1.48-2.fc13 mysql-libs.x86_64 0:5.1.48-2.fc13
mysql-server.x86_64 0:5.1.48-2.fc13
Dependency Installed:
perl-DBD-MySQL.x86_64 0:4.017-1.fc13

An init script, to stop and start the server, is installed to /etc/init.d/mysqld. You may need to edit  the /etc/my.cnf file according to your configuration needs/ To start out the MySQL server use service:

$ service mysqld start

use chkconfig:

$ chkconfig --levels 235 mysqld on

Set the root user password for all local domains

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('new-password');
SET PASSWORD FOR 'root'@'localhost.localdomain' = PASSWORD('new-password');
SET PASSWORD FOR 'root'@'' = PASSWORD('new-password');


%d bloggers like this: