Enjoy Slackware 15.0!
Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
howtos:databases:install_mysql_on_slackware [2012/09/29 18:00 (UTC)] zithro [Configure MySQL] |
howtos:databases:install_mysql_on_slackware [2013/02/12 11:31 (UTC)] alienbob Layout changes (proper heading/enumeration) and use of correct english in the new UTF8 section. |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | < | + | < |
+ | <!-- Reviewed 2012-02-12 alienbob | ||
====== Install MySQL On Slackware ====== | ====== Install MySQL On Slackware ====== | ||
- | ===== Install | + | ===== Installing |
+ | Install MySQL from the official Slackware discs or using [[slackware: | ||
- | Install | + | ===== Configuring |
+ | - Create the needed database(s) and set their permissions properly \\ As root, run: < | ||
+ | root@darkstar# | ||
+ | </ | ||
+ | - Enable execution of the //rc script// to start MySQL automatically on boot \\ //This is optional.// < | ||
+ | root@darkstar# | ||
+ | </ | ||
+ | - Enable networking if needed \\ Networking is disabled by default to improve security. If you want to allow network connections, | ||
+ | # | ||
+ | </ | ||
+ | - Start mysqld < | ||
+ | root@darkstar# | ||
+ | </ | ||
- | ===== Configure | + | ===== Securing |
- | == 1) Create the needed database(s) and set their permissions properly == | + | < |
- | As root, run: | + | |
- | | + | |
- | User specified by '' | + | ==== Automatic configuration of secure access ==== |
+ | | ||
+ | root@darkstar# | ||
+ | </ | ||
- | == 2) Enable execution | + | ==== Manual configuration |
- | This is optional. | + | |
- | chmod 755 / | + | |
- | == 3) Enable | + | - Set a password for MySQL' |
+ | root@darkstar# | ||
+ | </ | ||
+ | root@darkstar# | ||
+ | </ | ||
+ | <note tip> | ||
+ | Check the '' | ||
+ | </ | ||
- | Networking is disabled by default to improve security. If you want to allow network connections, | + | ===== Connecting |
- | #SKIP=" | + | |
- | + | ||
- | == 4) Start mysqld | + | |
- | /etc/rc.d/rc.mysqld start | + | - Connect to your MySQL server using the following command < |
+ | user@darkstar$ mysql -u root -p | ||
+ | </code> | ||
+ | - For security reasons you should delete the anonymous user | ||
+ | * For the localhost server: < | ||
+ | mysql> use mysql | ||
+ | mysql> SELECT user, host FROM user; | ||
+ | mysql> DELETE FROM user WHERE host=' | ||
+ | </code> | ||
+ | * If you enabled networking, you should run this command instead: < | ||
+ | mysql> use mysql | ||
+ | mysql> SELECT user, host FROM user; | ||
+ | mysql> DELETE FROM user WHERE user=''; | ||
+ | </code> | ||
- | < | + | ==== Adding Unicode support == |
- | == AUTOMATIC == | + | - Change directory to the ''/ |
+ | - Edit ''/ | ||
+ | [mysqld] | ||
+ | collation-server | ||
+ | init-connect='SET NAMES utf8' | ||
+ | character-set-server | ||
+ | </ | ||
- | == 5) 6) 7) Run the following, answer the questions | + | More on Unicode / UTF8 character set support is described here: [[http:// |
- | + | ||
- | /usr/bin/ | + | |
- | Initial root password is "" | + | |
- | + | ||
- | == MANUAL == | + | |
- | + | ||
- | == 5) Set a password for MySQL' | + | |
- | + | ||
- | | + | |
- | + | ||
- | If you enabled networking, you should also run this command: | + | |
- | + | ||
- | | + | |
- | + | ||
- | <note tip> | + | |
- | + | ||
- | == 6) Connect to your MySQL server == | + | |
- | | + | |
- | + | ||
- | + | ||
- | == 7) For security reasons you should delete the anonymous user == | + | |
- | For the localhost server: | + | |
- | + | ||
- | | + | |
- | | + | |
- | | + | |
- | + | ||
- | If you enabled networking, you should run this command instead: | + | |
- | | + | |
- | | + | |
- | | + | |
===== Troubleshooting ===== | ===== Troubleshooting ===== | ||
- | * Server start errors can be seen in the error log that is located by default at ''/ | ||
- | |||
- | / | ||
- | |||
- | * Resetting the root password can be done by creating a new cnf file and add the following lines (please change the password in this example): | ||
- | | + | * Server start errors can be seen in the error log that is located by default at ''/ |
- | FLUSH PRIVILEGES; | + | root@darkstar# / |
+ | </ | ||
- | Save this file (any name would do) and start the server with the --init-file argument: | + | * Resetting the root password can be done by creating a new cnf file and add the following lines (please change the password in this example): <file sql mysql_new.cnf> |
- | + | UPDATE mysql.user SET Password=PASSWORD(' | |
- | / | + | FLUSH PRIVILEGES; |
- | + | </ | |
+ | root@darkstar# | ||
+ | </ | ||
====== Sources ====== | ====== Sources ====== | ||
Line 89: | Line 92: | ||
<!-- Please do not modify anything below, except adding new tags.--> | <!-- Please do not modify anything below, except adding new tags.--> | ||
- | <!-- You must remove the tag-word " | + | {{tag> |
- | {{tag> | + |