MySQL

dev-db/mysql


Source Repository:Repository:Gentoo Portage Tree

http://www.mysql.com/

Summary: MySQL is a fast, multi-threaded, multi-user SQL database server.

Use Flags

cluster
Add support for NDB clustering (deprecated)
community
Enables the community features from upstream.
embedded
Build embedded server (libmysqld)
extraengine
Add support for alternative storage engines (Archive, CSV, Blackhole, Federated(X), Partition)
jemalloc
Use dev-libs/jemalloc for allocations.
latin1
Use LATIN1 encoding instead of UTF8
libressl
Enable SSL connections and crypto functions using dev-libs/libressl
openssl
Enable SSL connections and crypto functions using dev-libs/openssl
max-idx-128
Raise the max index per table limit from 64 to 128
minimal
Install client programs only, no server
profiling
Add support for statement profiling (requires USE=community).
server
Build the server program
systemtap
Build support for profiling and tracing using dev-util/systemtap
test
Install upstream testsuites for end use.
yassl
Enable SSL connections and crypto functions using the bundled yaSSL

News

Oleg

GCC Update

GCC Update
2016-11-25 by Oleg
Oleg

Portage Git Sync Fix

Portage Git Sync fix
2016-11-14 by Oleg
Oleg

Python-3.3-Removal

Python-3.3 Removal from Portage Tree
2016-10-28 by Oleg
More...

MySQL

Tip

We welcome improvements to this page. To edit this page, Create a Funtoo account. Then log in and then click here to edit this page. See our editing guidelines to becoming a wiki-editing pro.

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.

Installation

# emerge mysql

First Run

MySQL requires configuration upon instillation.

To deploy MySQL:

# emerge --config dev-db/mysql

Init

To start mysql:

# rc-service mysql start
To start upon boot:

# rc-update add mysql default

Usage

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

Secure

Lockdown

MySQL is by default insecure.

to lock down your MySQL install:

# mysql_secure_installation

Logging

By default MySQL logs every action, including leaving plain text passwords in its history file.

To remove the history file:

# rm /root/.mysql_history
To automatically remove future history:

# ln -s /dev/null /root/.mysql_history

ZFS

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

Media

Programming