Sunday, 6 March 2016

How to install MySQL on Linux ?


Installing MySQL on Linux
1. Switch to superuser by typing "su" and give the root password
2. Change to the directory that has the RPM download.
3. Type the following command at the prompt : 
  rpm -ivh "mysql_file_name.rpm"
    Similarly, you can also install the MySQL client and MySQL development RPMs if you've downloaded them.
 4. Now we'll set a password for the root user. Issue the following at the prompt.
    mysqladmin -u root password mysqldata
    where mysqldata is the password for the root. (Change this to anything you like).

5. Test the program by typing the following at the prompt starts the mysql client program.
  mysql -u root -p
The system asks for the the password. Type the root password (mysqldata). If you don't get the prompt for password, it might be because MySQL Server is not running.
To start the server, change to /etc/rc.d/init.d/ directory and issue the command ./mysql start (or mysql start depending on the value of the PATH variable on your system). Now invoke mysql client program.
6. Once MySQL client is running, you should get the mysql> prompt. Type the following at this prompt:
    show databases;

Okay, we've successfully installed MySQL on your system.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.