Monday, February 23, 2015

How to install MySQL on CentOS from its repository

P

Installation

This tutorial will show you how to install MySQL on CentOS from its repository. Because it is installed from CentOS's repository then I'm sure the latest version of MySQL will be installed.
Open terminal and type with root privileges



yum -y install mysql-server

Make MySQL run once computer started


chkconfig mysqld on

Make MySQL run as service


service mysqld start
Change Root Password

Login MySQL with root account (Blank for password by default)

mysql -u root -p
Use this command to change root's password
use mysql;

UPDATE user SET Password=PASSWORD('MyNewPass') WHERE User='root';
Make an external access
GRANT ALL ON *.* to 'user1'@'theIP' IDENTIFIED BY 'password1';

flush privileges;
After this command executed, user1 has been created for theIP access to MySQL with password is password1. NOTE: if you want all IP address can be accessed MySQL just replace 'theIP' to '%'

No comments:

Post a Comment