How to install MySQL

From Cosmin's Wiki

Jump to: navigation, search

Home > Linux how to's > How to install MySQL



According to this page both MySQL and PostgreSQL are good alternatives of proprietary softwares like DB2, Sybase, Oracle, SQL Server etc.

To install both the server and client:

sudo apt-get install mysql-server-5.0

db4free is a great database server for tryout different things remotely. If you want to use this site, then you do not have to install MySQL server. Just install the client, documentation and php or jdbc connectivity.


Cosmin: I have also successfully installed the MySQL server by using this command:

aptitude install mysql-server


Accessing the MySQL server

By default, after having installed MySQL with the above procedure, it is accessible only from the localhost (or 127.0.0.1). If you want your server to be accessible from "outside", you need to edit the my.cnf file (usually located in /etc/mysql/my.cnf) and change the following line:

# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address            = <your ip here>

and put your computer's ip address.

Of course, if you haven't changed MySQL's default port and if you have a firewall (like iptables) active, do not forget to allow traffic on the 3306 port.