[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
howtos:databases:install_mysql_on_slackware [2012/12/20 02:22 (UTC)] – [Sources] added a tag mfillpot | howtos:databases:install_mysql_on_slackware [2013/02/12 11:31 (UTC)] (current) – Layout changes (proper heading/enumeration) and use of correct english in the new UTF8 section. alienbob | ||
---|---|---|---|
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> | + |