[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.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
howtos:databases:install_mysql_on_slackware [2012/09/26 02:35 (UTC)] – moved from the general howtos namespace mfillpot | howtos:databases:install_mysql_on_slackware [2013/01/06 03:58 (UTC)] – General cleanup - added tag mfillpot | ||
---|---|---|---|
Line 2: | Line 2: | ||
====== Install MySQL On Slackware ====== | ====== Install MySQL On Slackware ====== | ||
- | == INSTALL | + | ===== Install |
+ | Install MySQL from the official Slackware discs or using | ||
+ | [[slackware: | ||
- | Install | + | ===== Configure |
+ | == 1) Create | ||
+ | As root, run: | ||
+ | < | ||
+ | root@darkstar# | ||
+ | </ | ||
+ | User specified by '' | ||
+ | set right user here, otherwise MySQL won't be able to write to database. By | ||
+ | default MySQL in Slackware runs as user " | ||
- | == CONFIGURE | + | == 2) Enable execution of rc script to start MySQL automatically on boot == |
+ | //This is optional.// | ||
+ | < | ||
+ | root@darkstar# | ||
+ | </ | ||
- | 1) Create the needed database(s) and set their permissions properly. As root, run: | + | == 3) Enable networking if needed |
- | + | Networking is disabled by default to improve security. If you want to allow | |
- | | + | network connections, |
- | + | < | |
- | User specified by '' | + | # |
- | + | </ | |
- | 2) Enable execution of rc script to start MySQL automatically on boot: | + | |
- | + | ||
- | chmod 755 / | + | |
- | + | ||
- | 3) Enable networking if needed | + | |
- | + | ||
- | Networking is disabled by default to improve security. If you want to allow network connections, | + | |
- | | + | |
- | 4) Start mysqld: | + | == 4) Start mysqld |
+ | < | ||
+ | root@darkstar# | ||
+ | </ | ||
- | /etc/ | + | < |
+ | Now you have a choice : Manual Install or Automatic | ||
+ | </note> | ||
- | //NOW YOU HAVE A CHOICE - MANUAL INSTALL OR AUTOMATIC// | + | == AUTOMATIC == |
+ | == 5) 6) 7) Run the following, answer the questions == | ||
+ | < | ||
+ | root@darkstar# | ||
+ | </ | ||
+ | // Initial root password is "" | ||
- | AUTOMATIC: | + | == MANUAL == |
- | 5) 6) 7) Run the following, answer the questions: | + | == 5) Set a password for MySQL' |
+ | < | ||
+ | root@darkstar# | ||
+ | </ | ||
- | / | + | If you enabled networking, you should also run this command: |
- | | + | < |
+ | root@darkstar# mysqladmin -u root -h ' | ||
+ | </code> | ||
- | MANUAL: | + | <note tip> |
+ | Check the '' | ||
+ | copy/paste them. The hostname will already be replaced by yours. | ||
+ | </ | ||
- | 5) Set a password for MySQL' | + | == 6) Connect to your MySQL server == |
+ | < | ||
+ | user@darkstar$ mysql -u root -p | ||
+ | </ | ||
- | | ||
+ | == 7) For security reasons you should delete the anonymous user == | ||
+ | For the localhost server: | ||
- | 6) You can connect to your MySQL server with: | + | < |
- | | + | mysql> use mysql |
+ | mysql> SELECT user, host FROM user; | ||
+ | mysql> DELETE FROM user WHERE host=' | ||
+ | </ | ||
+ | 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=''; | ||
+ | </ | ||
- | 7) For security reasons you should delete an empty user for localhost | + | ===== Troubleshooting ===== |
+ | * Server start errors can be seen in the error log that is located by default at ''/ | ||
+ | < | ||
+ | root@darkstar# | ||
+ | </ | ||
- | | + | * 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): |
- | mysql> SELECT user, host FROM user; | + | <file> |
- | | + | UPDATE |
+ | FLUSH PRIVILEGES; | ||
+ | </ | ||
- | == TROUBLESHOOTING == | + | Save this file (any name would do) and start the server with the --init-file |
- | 1) Server start errors can be seen in the error log that is located by default at ''/ | + | argument: |
- | + | < | |
- | / | + | root@darkstar# |
- | + | </ | |
- | 2 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): | + | |
- | + | ||
- | UPDATE mysql.user SET Password=PASSWORD(' | + | |
- | FLUSH PRIVILEGES; | + | |
- | + | ||
- | Save this file (any name would do) and start the server with the --init-file argument: | + | |
- | + | ||
- | / | + | |
- | + | ||
====== Sources ====== | ====== Sources ====== | ||
Line 79: | Line 113: | ||
<!-- 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 " | <!-- You must remove the tag-word " | ||
- | {{tag> | + | {{tag> |