License : GPLv2 with exceptions and LGPLv2 and BSD
Description : MySQL is a multi-user, multi-threaded SQL database server. MySQL is a
: client/server implementation consisting of a server daemon (mysqld)
: and many different client programs and libraries. This package contains
: the MySQL server and some accompanying files and directories.
# dnf info mysql-server.x86_64
Last metadata expiration check: 0:46:13 ago on Fri 04 Jun 2021 12:19:29 PM JST.
Available Packages
Name : mysql-server
Version : 8.0.21
Release : 1.module_el8.4.0+589+11e12751
Architecture : x86_64
Size : 22 M
Source : mysql-8.0.21-1.module_el8.4.0+589+11e12751.src.rpm
Repository : appstream
Summary : The MySQL server and related files
URL : http://www.mysql.com
License : GPLv2 with exceptions and LGPLv2 and BSD
Description : MySQL is a multi-user, multi-threaded SQL database server. MySQL is a
: client/server implementation consisting of a server daemon (mysqld)
: and many different client programs and libraries. This package contains
: the MySQL server and some accompanying files and directories.
# dnf info mysql-server.x86_64
Last metadata expiration check: 0:46:13 ago on Fri 04 Jun 2021 12:19:29 PM JST.
Available Packages
Name : mysql-server
Version : 8.0.21
Release : 1.module_el8.4.0+589+11e12751
Architecture : x86_64
Size : 22 M
Source : mysql-8.0.21-1.module_el8.4.0+589+11e12751.src.rpm
Repository : appstream
Summary : The MySQL server and related files
URL : http://www.mysql.com
License : GPLv2 with exceptions and LGPLv2 and BSD
Description : MySQL is a multi-user, multi-threaded SQL database server. MySQL is a
: client/server implementation consisting of a server daemon (mysqld)
: and many different client programs and libraries. This package contains
: the MySQL server and some accompanying files and directories.
↑ MySQL 8.0.21
をインストールできます。
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# dnf install mysql-server.x86_64
Last metadata expiration check: 0:46:51 ago on Fri 04 Jun 2021 12:19:29 PM JST.
VALIDATE PASSWORD COMPONENT can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD component?
Press y|Y for Yes, any other key for No: y
# mysql_secure_installation
Securing the MySQL server deployment.
Connecting to MySQL using a blank password.
VALIDATE PASSWORD COMPONENT can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD component?
Press y|Y for Yes, any other key for No: y
# mysql_secure_installation
Securing the MySQL server deployment.
Connecting to MySQL using a blank password.
VALIDATE PASSWORD COMPONENT can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD component?
Press y|Y for Yes, any other key for No: y
↑「y」を押します。(あるいは、Enterキーを押します)
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
There are three levels of password validation policy:
LOW Length >= 8
MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary file
Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2
There are three levels of password validation policy:
LOW Length >= 8
MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary file
Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2
There are three levels of password validation policy:
LOW Length >= 8
MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary file
Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2
↑ パスワードの強度を設定します。「2」を入れます。
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
Please set the password for root here.
New password: (パスワード)
Re-enter new password: (パスワード)
Please set the password for root here.
New password: (パスワード)
Re-enter new password: (パスワード)
Please set the password for root here.
New password: (パスワード)
Re-enter new password: (パスワード)
↑ パスワードを入れます。
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
Estimated strength of the password: 100
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
Estimated strength of the password: 100
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
Estimated strength of the password: 100
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
↑ パスワードの強度として、強い「100」となりましたので、このまま「y」を押して次に進めます。
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.
Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Success.
Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
Success.
By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
- Dropping test database...
Success.
- Removing privileges on test database...
Success.
Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
Success.
All done!
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.
Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Success.
Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
Success.
By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
- Dropping test database...
Success.
- Removing privileges on test database...
Success.
Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
Success.
All done!
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.
Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Success.
Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
Success.
By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
- Dropping test database...
Success.
- Removing privileges on test database...
Success.
Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
Success.
All done!
↑ その他、そのまま、リターンキーを押して、進めます。
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.0.21 Source distribution
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.0.21 Source distribution
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.01 sec)
mysql> show variables like 'character%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8mb4 |
| character_set_connection | utf8mb4 |
| character_set_database | utf8mb4 |
| character_set_filesystem | binary |
| character_set_results | utf8mb4 |
| character_set_server | utf8mb4 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.01 sec)
mysql>
# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.0.21 Source distribution
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.01 sec)
mysql> show variables like 'character%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8mb4 |
| character_set_connection | utf8mb4 |
| character_set_database | utf8mb4 |
| character_set_filesystem | binary |
| character_set_results | utf8mb4 |
| character_set_server | utf8mb4 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.01 sec)
mysql>
# wget https://github.com/unicode-org/icu/releases/download/release-69-1/icu4c-69_1-src.tgz
# cd icu/source
# ./runConfigureICU Linux
# make
# make install
# wget https://github.com/unicode-org/icu/releases/download/release-69-1/icu4c-69_1-src.tgz
# cd icu/source
# ./runConfigureICU Linux
# make
# make install
# wget http://download.oracle.com/berkeley-db/db-6.2.32.tar.gz
# tar xzvf db-6.2.32.tar.gz
# cd db-6.2.32/build_unix/
# ../dist/configure --prefix=/usr/
# make
# make install
# wget http://download.oracle.com/berkeley-db/db-6.2.32.tar.gz
# tar xzvf db-6.2.32.tar.gz
# cd db-6.2.32/build_unix/
# ../dist/configure --prefix=/usr/
# make
# make install
cp: cannot stat 'bdb-sql': No such file or directory
cp: cannot stat 'gsg_db_server': No such file or directory
make: *** [Makefile:1310: install_docs] Error 1
Installing documentation: /usr/docs ...
cp: cannot stat 'bdb-sql': No such file or directory
cp: cannot stat 'gsg_db_server': No such file or directory
make: *** [Makefile:1310: install_docs] Error 1
Installing documentation: /usr/docs ...
cp: cannot stat 'bdb-sql': No such file or directory
cp: cannot stat 'gsg_db_server': No such file or directory
make: *** [Makefile:1310: install_docs] Error 1
postfix: warning: smtputf8_enable is true, but EAI support is not compiled in
Warning: you still need to edit myorigin/mydestination/mynetworks
parameter settings in /etc/postfix/main.cf.
See also http://www.postfix.org/STANDARD_CONFIGURATION_README.html
for information about dialup sites or about sites inside a firewalled
network.
BTW: Check your /etc/aliases file and be sure to set up aliases
that send mail for root and postmaster to a real person, then run
/usr/bin/newaliases.
# cd postfix-3.6.0/
# make makefiles CCARGS='-DUSE_TLS -DUSE_SASL_AUTH -DHAS_MYSQL -DDEF_SERVER_SASL_TYPE=\"dovecot\" -I/usr/local/include -I/usr/include/mysql/' AUXLIBS="-lssl -lcrypto -L/usr/local/lib" 'AUXLIBS_MYSQL=-L/usr/lib64/mysql -lmysqlclient -lz -lm'
# make
# make install
(略)
Updating /usr/local/man/man8/verify.8...
Updating /usr/local/man/man8/virtual.8...
postfix: warning: smtputf8_enable is true, but EAI support is not compiled in
Warning: you still need to edit myorigin/mydestination/mynetworks
parameter settings in /etc/postfix/main.cf.
See also http://www.postfix.org/STANDARD_CONFIGURATION_README.html
for information about dialup sites or about sites inside a firewalled
network.
BTW: Check your /etc/aliases file and be sure to set up aliases
that send mail for root and postmaster to a real person, then run
/usr/bin/newaliases.
# cd postfix-3.6.0/
# make makefiles CCARGS='-DUSE_TLS -DUSE_SASL_AUTH -DHAS_MYSQL -DDEF_SERVER_SASL_TYPE=\"dovecot\" -I/usr/local/include -I/usr/include/mysql/' AUXLIBS="-lssl -lcrypto -L/usr/local/lib" 'AUXLIBS_MYSQL=-L/usr/lib64/mysql -lmysqlclient -lz -lm'
# make
# make install
(略)
Updating /usr/local/man/man8/verify.8...
Updating /usr/local/man/man8/virtual.8...
postfix: warning: smtputf8_enable is true, but EAI support is not compiled in
Warning: you still need to edit myorigin/mydestination/mynetworks
parameter settings in /etc/postfix/main.cf.
See also http://www.postfix.org/STANDARD_CONFIGURATION_README.html
for information about dialup sites or about sites inside a firewalled
network.
BTW: Check your /etc/aliases file and be sure to set up aliases
that send mail for root and postmaster to a real person, then run
/usr/bin/newaliases.
↑ インストールできました。
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# postfix start
postfix: warning: smtputf8_enable is true, but EAI support is not compiled in
postsuper: warning: smtputf8_enable is true, but EAI support is not compiled in
postfix/postlog: warning: smtputf8_enable is true, but EAI support is not compiled in
postfix/postfix-script: starting the Postfix mail system
# ps ax |grep post
59309 ? Ss 0:00 /usr/libexec/postfix/master -w
# postfix start
postfix: warning: smtputf8_enable is true, but EAI support is not compiled in
postsuper: warning: smtputf8_enable is true, but EAI support is not compiled in
postfix/postlog: warning: smtputf8_enable is true, but EAI support is not compiled in
postfix/postfix-script: starting the Postfix mail system
# ps ax |grep post
59309 ? Ss 0:00 /usr/libexec/postfix/master -w
# postfix start
postfix: warning: smtputf8_enable is true, but EAI support is not compiled in
postsuper: warning: smtputf8_enable is true, but EAI support is not compiled in
postfix/postlog: warning: smtputf8_enable is true, but EAI support is not compiled in
postfix/postfix-script: starting the Postfix mail system
# ps ax |grep post
59309 ? Ss 0:00 /usr/libexec/postfix/master -w
↑ 起動はできました。
「広告」
PostfixAdmin関係
php 7.4
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# dnf module list php
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered with an entitlement server. You can use subscription-manager to register.
Last metadata expiration check: 1 day, 4:26:32 ago on Sun 06 Jun 2021 10:05:22 AM JST.
CentOS Stream 8 - AppStream
Name Stream Profiles Summary
php 7.2 [d] common [d], devel, minimal PHP scripting language
php 7.3 common [d], devel, minimal PHP scripting language
php 7.4 common [d], devel, minimal PHP scripting language
# dnf module list php
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered with an entitlement server. You can use subscription-manager to register.
Last metadata expiration check: 1 day, 4:26:32 ago on Sun 06 Jun 2021 10:05:22 AM JST.
CentOS Stream 8 - AppStream
Name Stream Profiles Summary
php 7.2 [d] common [d], devel, minimal PHP scripting language
php 7.3 common [d], devel, minimal PHP scripting language
php 7.4 common [d], devel, minimal PHP scripting language
Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled
# dnf module list php
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered with an entitlement server. You can use subscription-manager to register.
Last metadata expiration check: 1 day, 4:26:32 ago on Sun 06 Jun 2021 10:05:22 AM JST.
CentOS Stream 8 - AppStream
Name Stream Profiles Summary
php 7.2 [d] common [d], devel, minimal PHP scripting language
php 7.3 common [d], devel, minimal PHP scripting language
php 7.4 common [d], devel, minimal PHP scripting language
Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled
Active: active (running) since Mon 2021-XX-XX XX:XX:XX JST; 2s ago
Main PID: 2294 (php-fpm)
Status: "Ready to handle connections"
Tasks: 6 (limit: 11403)
Memory: 9.7M
CGroup: /system.slice/php-fpm.service
├─2294 php-fpm: master process (/etc/php-fpm.conf)
├─2295 php-fpm: pool www
├─2296 php-fpm: pool www
├─2297 php-fpm: pool www
├─2298 php-fpm: pool www
└─2299 php-fpm: pool www
systemd[1]: Starting The PHP FastCGI Process Manager...
systemd[1]: Started The PHP FastCGI Process Manager.
# systemctl start php-fpm
# systemctl status php-fpm
● php-fpm.service - The PHP FastCGI Process Manager
Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; disabled; vendor preset: disabled)
Active: active (running) since Mon 2021-XX-XX XX:XX:XX JST; 2s ago
Main PID: 2294 (php-fpm)
Status: "Ready to handle connections"
Tasks: 6 (limit: 11403)
Memory: 9.7M
CGroup: /system.slice/php-fpm.service
├─2294 php-fpm: master process (/etc/php-fpm.conf)
├─2295 php-fpm: pool www
├─2296 php-fpm: pool www
├─2297 php-fpm: pool www
├─2298 php-fpm: pool www
└─2299 php-fpm: pool www
systemd[1]: Starting The PHP FastCGI Process Manager...
systemd[1]: Started The PHP FastCGI Process Manager.
# systemctl start php-fpm
# systemctl status php-fpm
● php-fpm.service - The PHP FastCGI Process Manager
Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; disabled; vendor preset: disabled)
Active: active (running) since Mon 2021-XX-XX XX:XX:XX JST; 2s ago
Main PID: 2294 (php-fpm)
Status: "Ready to handle connections"
Tasks: 6 (limit: 11403)
Memory: 9.7M
CGroup: /system.slice/php-fpm.service
├─2294 php-fpm: master process (/etc/php-fpm.conf)
├─2295 php-fpm: pool www
├─2296 php-fpm: pool www
├─2297 php-fpm: pool www
├─2298 php-fpm: pool www
└─2299 php-fpm: pool www
systemd[1]: Starting The PHP FastCGI Process Manager...
systemd[1]: Started The PHP FastCGI Process Manager.
# cp -a postfixadmin-postfixadmin-7d04685/ /var/www/postfixadmin
# wget https://sourceforge.net/projects/postfixadmin/files/postfixadmin-3.3.8/PostfixAdmin%203.3.8.tar.gz/download -O PostfixAdmin.3.3.8.tar.gz
# tar xzvf PostfixAdmin.3.3.8.tar.gz
# cp -a postfixadmin-postfixadmin-7d04685/ /var/www/postfixadmin
# wget https://sourceforge.net/projects/postfixadmin/files/postfixadmin-3.3.8/PostfixAdmin%203.3.8.tar.gz/download -O PostfixAdmin.3.3.8.tar.gz
# tar xzvf PostfixAdmin.3.3.8.tar.gz
# cp -a postfixadmin-postfixadmin-7d04685/ /var/www/postfixadmin
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# vi /etc/httpd/conf/httpd.conf
Alias /postfixadmin "/var/www/postfixadmin/public"
# vi /etc/httpd/conf/httpd.conf
Alias /postfixadmin "/var/www/postfixadmin/public"
# vi /etc/httpd/conf/httpd.conf
Alias /postfixadmin "/var/www/postfixadmin/public"
PostfixAdmin用DB作成
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# mysql -u root -p
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> insert into user (host,User,authentication_string,ssl_cipher,x509_issuer,x509_subject) values ('localhost','(DB用ユーザ)','','','','');
Query OK, 1 row affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> ALTER USER '(DB用ユーザ)'@'localhost' IDENTIFIED BY '(DB用パスワード)';
Query OK, 0 rows affected (0.01 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> insert into db (host,db,user) values ('localhost','(DB名)','(DB用ユーザ)');
Query OK, 1 row affected (0.01 sec)
mysql> update db set Select_priv='Y',Insert_priv='Y',Update_priv='Y',Delete_priv='Y',Create_priv='Y',Drop_priv='Y',Grant_priv='Y',References_priv='Y',Index_priv='Y',Alter_priv='Y',Create_tmp_table_priv='Y',Lock_tables_priv='Y',Create_view_priv='Y',Show_view_priv='Y',Create_routine_priv='Y',Alter_routine_priv='Y',Execute_priv='Y',Event_priv='Y',Trigger_priv='Y' where db='(DB名)';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> create database (DB名);
Query OK, 1 row affected (0.01 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
# mysql -u root -p
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> insert into user (host,User,authentication_string,ssl_cipher,x509_issuer,x509_subject) values ('localhost','(DB用ユーザ)','','','','');
Query OK, 1 row affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> ALTER USER '(DB用ユーザ)'@'localhost' IDENTIFIED BY '(DB用パスワード)';
Query OK, 0 rows affected (0.01 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> insert into db (host,db,user) values ('localhost','(DB名)','(DB用ユーザ)');
Query OK, 1 row affected (0.01 sec)
mysql> update db set Select_priv='Y',Insert_priv='Y',Update_priv='Y',Delete_priv='Y',Create_priv='Y',Drop_priv='Y',Grant_priv='Y',References_priv='Y',Index_priv='Y',Alter_priv='Y',Create_tmp_table_priv='Y',Lock_tables_priv='Y',Create_view_priv='Y',Show_view_priv='Y',Create_routine_priv='Y',Alter_routine_priv='Y',Execute_priv='Y',Event_priv='Y',Trigger_priv='Y' where db='(DB名)';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> create database (DB名);
Query OK, 1 row affected (0.01 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
# mysql -u root -p
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> insert into user (host,User,authentication_string,ssl_cipher,x509_issuer,x509_subject) values ('localhost','(DB用ユーザ)','','','','');
Query OK, 1 row affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> ALTER USER '(DB用ユーザ)'@'localhost' IDENTIFIED BY '(DB用パスワード)';
Query OK, 0 rows affected (0.01 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> insert into db (host,db,user) values ('localhost','(DB名)','(DB用ユーザ)');
Query OK, 1 row affected (0.01 sec)
mysql> update db set Select_priv='Y',Insert_priv='Y',Update_priv='Y',Delete_priv='Y',Create_priv='Y',Drop_priv='Y',Grant_priv='Y',References_priv='Y',Index_priv='Y',Alter_priv='Y',Create_tmp_table_priv='Y',Lock_tables_priv='Y',Create_view_priv='Y',Show_view_priv='Y',Create_routine_priv='Y',Alter_routine_priv='Y',Execute_priv='Y',Event_priv='Y',Trigger_priv='Y' where db='(DB名)';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> create database (DB名);
Query OK, 1 row affected (0.01 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)