Installing MySQL on Linux

I know there is already how tos out there but I figured I would post my own, just to make it easier for me to find it if I need it in the future.

To install MySQL run the following command in Terminal

$sudo apt-get install mysql-server

During the install you will be prompted to enter the root password, you can later change this.

MySQL should now be running to check this type:

sudo netstat -tap | grep mysql

You should see the following output:

tcp        0      0 localhost:mysql         *:*                     LISTEN      2556/mysqld

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

er making a change to /etc/mysql/my.cnf the mysql daemon will need to be restarted:

sudo /etc/init.d/mysql restart

If you would like to change the MySQL root password, in a terminal enter:

sudo dpkg-reconfigure mysql-server-5.1

The mysql daemon will be stopped, and you will be prompted to enter a new password.

Advertisements

About Paul Cardelli, CISSP
Cyber Security Analyst, and computer guru

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: