![]() |
|
ADSP 21xx
Have you found this site useful? Did we save you time? Did we cure your head-ache? Is your hair growing back now? Please make a donation to help with maintenance. |
MySQL HowtoFor Mandrake 9.1 with MySQL 4.0.11a August 2003. Herman Oosthuysen Aerospace Software Ltd., http://www.AerospaceSoftware.com, Copyright 2003, GPL: http://www.gnu.org. GeneralThis is yet another MySQL howto, but it is not intended to replace the documentation. It describes MySQL configuration and useage tricks and traps and debug issues, that may help you in your daily scirmishes with this powerful database system. I wrote this guide, when I wanted to create a database and then could not get a common user to connect, due to a problem with the grant command. The solution is detailed below. InstallationYou need the following rpms from your Mandrake CDs:
Directories and files
Don't delete the mysql database. If you do so accidentally, then the easiest way to recover is to re-install MySQL from scratch, by removing the rpms and then installing them again and then re-create all the MySQL users and passwords. Personal configuration is in file /home/user/.my.cnf:
Putting the password in there is handy, but not a good idea in an insecure environment. To enable host access add the following line to /etc/hosts.allow:
else tcpwrappers may block a connection attempt from another host on your network. Note: For proper
security, you have to create a password for the root user. Common CommandsAs root, you create a database, use the database and then create a table. Only then, can you assign users to the database and grant them privileges. With some versions of MySQL, you don't need to create a table first, but in all cases you must have a database to assign the users to. The grant command will also create a password for the user. Some common administrative commands:
Note that the grant command requires the @hostname specifier, else it won't work. I don't know whether this is a bug or an undocumented security update to MySQL. The command flush privileges will force MySQL to re-read the user privileges table. Lost admin passwordIf you need to take over a database and the previous administrator neglected to tell you the password, use the following recipe:
You should now be able to connect using the new password. Network AccessIf you are trying to connect to a remote database and you cannot, check if MySQL is configured for networking. Disable option --skip-networking in the MySQL configuration file. Hope this helps! Herman |
|
Copyright © 2005-2008, Aerospace Software Ltd., GPL. |