In this lesson you will learn how to install MySQL on CentOS and Redhat Linux.
MySQL is a freely available open source Relational Database Management System (RDBMS) that uses Structured Query Language (SQL). SQL is the most popular language for adding, accessing and managing content in a database. It is most noted for its quick processing, proven reliability, ease and flexibility of use.
How to install MySQL
- Install MySQL
123yum install mysql-server mysql php-mysql
How to configure MySQL
- Set the MySQL service to start on boot
123chkconfig --levels 235 mysqld on
- Start the MySQL service
123service mysqld start
- Log into MySQL
123mysql -u root
- Set the root user password for all local domains
12345SET PASSWORD FOR 'root'@'localhost' = PASSWORD('new-password');SET PASSWORD FOR 'root'@'localhost.localdomain' = PASSWORD('new-password');SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('new-password');
- Drop the Any user
1234DROP USER ''@'localhost';DROP USER ''@'localhost.localdomain';
- Exit MySQL
Hope it will help you and now you know how to install MySQL.