Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
procedures:install_mysql_on_archlinux [2016/08/22 21:51]
far305
procedures:install_mysql_on_archlinux [2016/08/24 22:05] (current)
xif ↷ Page moved from brice:install_mysql_on_archlinux to procedures:install_mysql_on_archlinux
Line 1: Line 1:
 +====== Install MySQL on Archlinux ======
 +
 +Install ''​mariadb''​ **without starting mysqld** :
 +
 +<code bash>
 +pacman -Sy mariadb
 +</​code>​
 +
 +Install the database :
 +<code bash>
 +mysql_install_db --user=mysql --basedir=/​usr --datadir=/​var/​lib/​mysql
 +</​code>​
 +
 +Start the ''​mysqld''​ service, and run ''​mysql_secure_installation''​ :
 +  * Give a biiiiigg password to the ''​root''​ user and disable remote access to it
 +  * Remove anonymous user accouts
 +  * Remove the test database
 +
 +Restart the ''​mysqld''​ service, and connect to the database using ''​mysql -u root -p''​. Run the following commands :
 +
 +  * CREATE USER '​[USERNAME]'​@'​localhost'​ IDENTIFIED BY '​[A_GOOD_PASS]';​
 +  * CREATE DATABASE [USER]_db;
 +  * GRANT ALL PRIVILEGES ON [THE_SAME_DB].* TO '​[THE_SAME_USER]'​@'​%';​
 +  * FLUSH PRIVILEGES;
 +
 +Now edit /​etc/​mysql/​my.cnf and comment (with #) the lines:
 +  * #​bind-address = <some ip-address> ​                 ​
 +  * #​skip-networking
 +
 +Restart ''​mysqld''​. Congratulations,​ you just install the worst database ever on the best OS ever.