Enjoy Slackware 15.0!
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision Next revision Both sides next revision | ||
howtos:databases:install_mysql_on_slackware [2012/09/26 02:35 (UTC)] mfillpot moved from the general howtos namespace |
howtos:databases:install_mysql_on_slackware [2013/02/11 16:49 (UTC)] wisedraco [Configure MySQL] |
||
---|---|---|---|
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 | + | ===== 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 | + | == 3) Enable networking if needed |
+ | Networking is disabled by default to improve security. If you want to allow | ||
+ | network connections, comment out this line in ''/ | ||
+ | <file sh rc.mysqld> | ||
+ | # | ||
+ | </ | ||
- | | + | == 4) Start mysqld == |
+ | < | ||
+ | root@darkstar# | ||
+ | </ | ||
- | User specified by '' | + | < |
+ | Now you have a choice | ||
+ | </ | ||
- | 2) Enable execution of rc script to start MySQL automatically on boot: | + | == AUTOMATIC == |
+ | == 5) 6) 7) Run the following, answer the questions == | ||
+ | < | ||
+ | root@darkstar# | ||
+ | </ | ||
+ | // Initial root password is "" | ||
- | chmod 755 / | + | == MANUAL == |
- | 3) Enable networking if needed | + | == 5) Set a password for MySQL' |
+ | < | ||
+ | root@darkstar# | ||
+ | </ | ||
- | Networking is disabled by default to improve security. | + | If you enabled networking, you should also run this command: |
- | | + | < |
- | + | root@darkstar# mysqladmin | |
- | 4) Start mysqld: | + | </ |
- | /etc/rc.d/rc.mysqld start | + | <note tip> |
+ | Check the '' | ||
+ | copy/paste them. The hostname will already be replaced by yours. | ||
+ | </note> | ||
- | //NOW YOU HAVE A CHOICE | + | == 6) Connect to your MySQL server == |
+ | < | ||
+ | user@darkstar$ mysql -u root -p | ||
+ | </code> | ||
- | AUTOMATIC: | ||
- | 5) 6) 7) Run the following, answer | + | == 7) For security reasons you should delete |
+ | For the localhost server: | ||
- | / | + | < |
- | | + | mysql> use mysql |
+ | mysql> SELECT user, host FROM user; | ||
+ | mysql> DELETE FROM user WHERE host=' | ||
+ | </code> | ||
- | MANUAL: | + | 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=''; | ||
+ | </ | ||
- | 5) Set a password | + | == Finish set configfile == |
+ | * Go to ''/ | ||
+ | * Edit ''/ | ||
+ | < | ||
+ | [mysqld] | ||
+ | collation-server = utf8_unicode_ci | ||
+ | init-connect=' | ||
+ | character-set-server = utf8 | ||
+ | </ | ||
+ | This gives you full utf8 on your mysql server, after restart it. | ||
- | | ||
+ | ===== Troubleshooting ===== | ||
+ | * Server start errors can be seen in the error log that is located by default at ''/ | ||
+ | < | ||
+ | root@darkstar# | ||
+ | </ | ||
- | 6) You can connect to your MySQL server with: | + | * Resetting the root password |
- | | + | <file sql mysql_new.cnf> |
+ | UPDATE | ||
+ | FLUSH PRIVILEGES; | ||
+ | </ | ||
- | + | Save this file (any name would do) and start the server with the --init-file | |
- | 7) For security reasons you should delete an empty user for localhost server | + | argument: |
- | + | < | |
- | | + | root@darkstar# |
- | | + | </ |
- | | + | |
- | + | ||
- | == TROUBLESHOOTING == | + | |
- | 1) Server start errors can be seen in the error log that is located by default at ''/ | + | |
- | + | ||
- | / | + | |
- | + | ||
- | 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 126: | ||
<!-- 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> |