0
MySQL (RDBMS) is a server that allows users to access databases. MySQL is the most widespread and popular open source database engine in the world.


There are many MySQL versions, here are some of them:

- MySQL Database Server Community Edition: The open source version provided with Fedora.

- MySQL Enterprise: A commercial version.

1.1 MySQL Installation

To install MySQL on Fedora, open the terminal (Applications >> System Tools >> Terminal), then run this command:

    su -c 'yum install mysql-server'

1.2 Start/Stop MySQL Server

To start MySQL server, run this command:

    su -lc 'service mysqld start'

To stop MySQL server, run this command:

    su -lc 'service mysqld stop'

If you want MySQL server to start at computer startup, then execute this command:

    su -lc 'chkconfig mysqld on'

To check if MySQL is running, then execute this command:

    mysql --user root --execute "select version()"

1.3 Security

By default, a root user is created without a password. It's necessary that you assign a password for this user immediately, especially when you are in computer connected to a network. 

$ mysql --user root
mysql> UPDATE mysql.user SET Password = PASSWORD('Your-Password-Here') WHERE User = 'root';
mysql> FLUSH PRIVILEGES;
mysql> exit

Another effective solution to change root user password consists of using the security script provided with MySQL:

    mysql_secure_installation

You need to respond to all questions by typing Y (Yes) in order to secure your server. After completing the previous operation, you need to add --password option:

    mysql --user root --password --execute "select version()"

The root user password is needed.

1.4 Files and Directories to Know

- /etc/my.cnf: Main config file.

- ~/.my.cnf: User config file.

- /var/log/mysqld.log: Server log.

- /var/lib/mysql/: The directory containing server data (databases).

Post a Comment

 
Top