Installing & Configuring MySQL Server

# yum install mysql mysql-server

(or)
rpm recommended method (of particular version)
i.e; rpm of client and rpm of server

Start MySQL server daemon (mysqld):

To restart, start or stop MySQL server from the command line
————————————————————-
/etc/init.d/mysqld status

/etc/init.d/mysqld start

/etc/init.d/mysqld stop

/etc/init.d/mysqld restart

—–(At Last if nothing works for starting MySQL) You can start the MySQL daemon with:——-
Running and Shutting down MySQL Server:
—————————————————————————————————————-

First check if your MySQL server is running or not.

ps -ef | grep mysqld

If your MySql is running, then you will see mysqld process listed out in your result.
If server is not running, then you can start it by using the following command:

root@host# cd /usr/bin
./safe_mysqld &

Now, if you want to shut down an already running MySQL server, then you can do it by using the following command:

root@host# cd /usr/bin
./mysqladmin -u root -p shutdown
Enter password: ******

–Setting New Root Password–

/usr/bin/mysqladmin -u root password ‘new-password’
/usr/bin/mysqladmin -u root -h angstrom password ‘new-password’
Starting MySQL:

Login as root database admin to MySQL server:

# mysql -u root
password:

mysql>
Delete ALL users who are not root:

mysql> delete from mysql.user where not (host=”localhost” and user=”root”);

mysql> FLUSH PRIVILEGES;

Change root database admin password: (note: once this step is complete you’ll need to login with: mysql -p -u root)

mysql> SET PASSWORD FOR ‘root’@’localhost’ = PASSWORD(‘mypass’);

mysql> FLUSH PRIVILEGES;

Advertisements
Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: