Saturday, July 24, 2010

? How to install Mysql5.1 Server in Ubuntu 10.04 Server edition

To install MySQL, run the following command from a terminal prompt:

sudo apt-get install mysql-server
During the installation process you will be prompted to enter a password for the MySQL root user.

Once the installation is complete, the MySQL server should be started automatically. You can run the following command from a terminal prompt to check whether the MySQL server is running:

sudo netstat -tap | grep mysql
When you run this command, you should see the following line or something similar:

tcp        0      0 localhost.localdomain:mysql           *:* LISTEN -

If the server is not running correctly, you can type the following command to start it:
sudo /etc/init.d/mysql restart


Network Configuration :
You can edit the /etc/mysql/my.cnf file to configure the basic settings -- log file, port number, etc. For example, to configure MySQL to listen for connections from network hosts, change the bind_address directive to the server's IP address:

bind-address            = 192.168.0.5
Replace 192.168.0.5 with the appropriate address.


or 


Comment the whole line, where in system will act perfectly in a DHCP env.

After making a change to /etc/mysql/my.cnf the mysql daemon will need to be restarted:
sudo /etc/init.d/mysql restart






User Configuration:
Log in to mysql server using
mysql -u root -p


GRANT ALL PRIVILEGES ON *.* TO 'myaccount'@'%' IDENTIFIED BY 'some_pass' WITH GRANT OPTION


The above should be executed for all the users of MySQL server. Also this should be executed replacing '%' with '%/localhost/ipaddress'  times.


Now try to connect to MySQL server using clients like Toad, SQL Yog and you are in.









No comments:

Post a Comment