MySQL

From Mandriva Community Wiki

Jump to: navigation, search
MySQL is the most widely used Open Source database as well as one of the fastest available databases. You can administer it with the phpmyadmin package, Webmin, and the Mandriva Webadmin tool. You can create a dynamic php based website as the interface for MYSQL. Any data input can then be accomlished through a unique, web-based form. Imagine accessing data on your personal or company website quickly without ever seeing the database. Want to collate and catalog your CD collection? MySQL is the way to do it. There are many publications available to help you learn more.
MySQL
Image:MySQL-icon.png
MySQL is a perfect partner for PHP. Drupal and Joomla are good examples.



Contents

Install Mysql

Open a console as root and type the following command :

Image:Konsole.png
[root@computer ~]# urpmi mysql


Start Mysql

Open a console as root and type the following command :

Image:Konsole.png
[root@computer ~]# service mysqld start


Configure and secure Mysql

Start Mysql and type:

/usr/bin/mysql_secure_installation

Since you have no password for the root user yet, press ENTER at the first prompt to create one.

Type in your password

Confirm your password


After that you can safely answer yes to every prompt:


Image:Konsole.png
[root@computer ~]# /usr/bin/mysql_secure_installation

By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment.

... Remove anonymous users? [Y/n] (Type y)

... Success!

Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network.

-n Disallow root login remotely? [Y/n] (Type y)

... Success!

By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment.

-n Remove test database and access to it? [Y/n] (Type y)

- Dropping test database... ... Success! - Removing privileges on test database... ... Success!

Reloading the privilege tables will ensure that all changes made so far will take effect immediately.

-n Reload privilege tables now? [Y/n] (Type y)

... Success!

Install PhpMyAdmin

  • Just install it via Image:drakrpm-icon.png drakrpm.
  • Phpmyadmin requires a working web server, like Apache, and the PHP scripting language implementation. It might be better to install task-lamp-php all at once to assure that the Linux-Apache-MySQL-PHP (LAMP) stack is in place. The last version of task-lamp-php will also install phpmyadmin.
  • Go to http://localhost/phpmyadmin and type in "root" as user and the password you provided during the mysql_secure_installation.
Caution !
If you install with Drakwizard,or manually - Mysql must be installed before phpmyadmin.
Personal tools
In other languages