|Source Repository:||Repository:Gentoo Portage Tree|
Summary: MySQL is a fast, multi-threaded, multi-user SQL database server.
- Add support for NDB clustering (deprecated)
- Enables the community features from upstream.
- Build embedded server (libmysqld)
- Add support for alternative storage engines (Archive, CSV, Blackhole, Federated(X), Partition)
- Use dev-libs/jemalloc for allocations.
- Use LATIN1 encoding instead of UTF8
- Enable SSL connections and crypto functions using dev-libs/libressl
- Enable SSL connections and crypto functions using dev-libs/openssl
- Raise the max index per table limit from 64 to 128
- Install client programs only, no server
- Add support for statement profiling (requires USE=community).
- Build the server program
- Build support for profiling and tracing using dev-util/systemtap
- Install upstream testsuites for end use.
- Enable SSL connections and crypto functions using the bundled yaSSL
New Ports-2017 tree and KitsFuntoo has a new ports-2017 tree, and introducing kits! (BETA)
MySQL is the M in the lamp/lemp/llmp stack. It is a popular, & common database that accepts SQL statements. Package:MariaDB & dev-db/percona-server (package not on wiki - please add) are drop in replacements for MySQL.
# emerge mysql
MySQL requires configuration upon instillation.
To deploy MySQL:
# emerge --config dev-db/mysql
To start mysql:
# rc-service mysql startTo start upon boot:
# rc-update add mysql default
To use mysql you will need to run MySQL as the funtoo root user, logging in as the mysql database root user. The system root user is not the same as the database root user, and passwords for both should be different.
# mysql -u root -p Enter password: mysql>
mysql is now blinking at you ready for SQL statements.
Root use is discouraged, for every database you require, create a user, and a database specific for the application, then allow the user access with as stripped down as possible permissions. We will use phpBB examples of creating a phpBB user & database.
# mysql -u root -p Enter password: mysql> CREATE USER 'phpbb'@'localhost' IDENTIFIED BY 'changeme'; mysql> CREATE DATABASE IF NOT EXISTS `phpbb` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`; mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `phpbb`.* TO 'phpbb'@'localhost' IDENTIFIED BY 'changeme'; mysql> \q
MySQL is by default insecure.
to lock down your MySQL install:
By default MySQL logs every action, including leaving plain text passwords in its history file.
To remove the history file:
# rm /root/.mysql_historyTo automatically remove future history:
# ln -s /dev/null /root/.mysql_history
If you are a zfs add the following to the mysql configuration file (/etc/mysql/my.cnf).
# echo "innodb_use_native_aio = 0" >> /etc/mysql/my.cnf