[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 revisionNext revisionBoth sides next revision | ||
howtos:databases:install_mysql_on_slackware [2012/09/29 18:00 (UTC)] – [Configure MySQL] zithro | howtos:databases:install_mysql_on_slackware [2013/01/06 04:05 (UTC)] – added REVIEWED comment mfillpot | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | <!-- Reviewed 2012-01-05 mfillpot --> | ||
<!-- Add your text below. We strongly advise to start with a Headline (see button bar above). --> | <!-- Add your text below. We strongly advise to start with a Headline (see button bar above). --> | ||
====== Install MySQL On Slackware ====== | ====== Install MySQL On Slackware ====== | ||
===== Install MySQL ===== | ===== Install MySQL ===== | ||
- | + | Install MySQL from the official Slackware discs or using | |
- | Install MySQL from the official Slackware discs or using [slackpkg]. | + | [[slackware:slackpkg|slackpkg]]. |
===== Configure MySQL ===== | ===== Configure MySQL ===== | ||
- | |||
== 1) Create the needed database(s) and set their permissions properly == | == 1) Create the needed database(s) and set their permissions properly == | ||
As root, run: | As root, run: | ||
- | mysql_install_db --user=mysql | + | < |
+ | root@darkstar# | ||
+ | </ | ||
- | User specified by '' | + | 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 " | ||
== 2) Enable execution of rc script to start MySQL automatically on boot == | == 2) Enable execution of rc script to start MySQL automatically on boot == | ||
- | This is optional. | + | //This is optional.// |
- | | + | < |
+ | root@darkstar# | ||
+ | </ | ||
== 3) Enable networking if needed == | == 3) Enable networking if needed == | ||
- | + | Networking is disabled by default to improve security. If you want to allow | |
- | Networking is disabled by default to improve security. If you want to allow network connections, | + | network connections, |
- | | + | < |
+ | # | ||
+ | </ | ||
== 4) Start mysqld == | == 4) Start mysqld == | ||
+ | < | ||
+ | root@darkstar# | ||
+ | </ | ||
- | / | + | < |
- | + | Now you have a choice : Manual Install or Automatic | |
- | < | + | </ |
== AUTOMATIC == | == AUTOMATIC == | ||
- | |||
== 5) 6) 7) Run the following, answer the questions == | == 5) 6) 7) Run the following, answer the questions == | ||
- | + | < | |
- | | + | root@darkstar# |
- | Initial root password is "" | + | </ |
+ | // Initial root password is "" | ||
== MANUAL == | == MANUAL == | ||
== 5) Set a password for MySQL' | == 5) Set a password for MySQL' | ||
- | + | < | |
- | | + | root@darkstar# |
+ | </ | ||
If you enabled networking, you should also run this command: | If you enabled networking, you should also run this command: | ||
+ | < | ||
+ | root@darkstar# | ||
+ | </ | ||
- | | + | <note tip> |
- | + | Check the '' | |
- | <note tip> | + | copy/paste them. The hostname will already be replaced by yours. |
+ | </ | ||
== 6) Connect to your MySQL server == | == 6) Connect to your MySQL server == | ||
- | mysql -u root -p | + | < |
+ | user@darkstar$ | ||
+ | </ | ||
Line 56: | Line 73: | ||
For the localhost server: | For the localhost server: | ||
- | mysql> use mysql | + | < |
- | | + | 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: | If you enabled networking, you should run this command instead: | ||
- | mysql> use mysql | + | < |
- | | + | mysql> use mysql |
- | | + | mysql> SELECT user, host FROM user; |
+ | mysql> DELETE FROM user WHERE user=''; | ||
+ | </ | ||
===== Troubleshooting ===== | ===== Troubleshooting ===== | ||
- | * Server start errors can be seen in the error log that is located by default at ''/ | + | * 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): | * 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 |
- | FLUSH PRIVILEGES; | + | argument: |
- | + | < | |
- | Save this file (any name would do) and start the server with the --init-file argument: | + | root@darkstar# |
- | + | </ | |
- | | + | |
- | + | ||
====== Sources ====== | ====== Sources ====== | ||
Line 90: | Line 114: | ||
<!-- 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> |