#권한su
[root@testdb]# /home/mysql/mariadb/bin/mysql_install_db --user=mysql --defaults-file=/etc/my.cnf --basedir=/home/mysql/mariadb --datadir=/home/mysql/mariadb_data
#Trouble shooting 1) 뭐냐 왜 안돼냐..my.cnf 돌려쓰기 실패.. # /data/svc/mariadb/bin/mysql_install_db --user=mysql --defaults-file=/etc/my.cnf --basedir=/data/svc/mariadb --datadir=/data/svc/mariadb_data Installing MariaDB/MySQL system tables in '/data/svc/mariadb_data' ... 2018-05-14 14:44:21 140143191357216 [Warning] 'THREAD_CONCURRENCY' is deprecated and will be removed in a future release. 2018-05-14 14:44:22 140143191357216 [ERROR] /data/svc/mariadb/bin/mysqld: unknown variable 'innodb_additional_mem_pool_size=32M' 2018-05-14 14:44:22 140143191357216 [ERROR] Aborting # => innodb_additional_mem_pool_size 주석처리함 #확인: innodb_additional_mem_pool_size was deprecated and has been removed, but innodb_file_format etc https://mariadb.com/kb/en/library/changes-improvements-in-mariadb-102/
By default, until MariaDB 10.1, MariaDB uses the XtraDB storage engine, a performance enhanced fork of the InnoDB storage engine. For compatibility reasons, the system variables still retain their original innodb prefixes, and where the text in this knowledge base refers to InnoDB, it can usually be understood as referring to the XtraDB fork. From MariaDB 10.2, InnoDB is the default (see Why MariaDB uses InnoDB instead of XtraDB from MariaDB 10.2). Note that it is possible to use InnoDB as a plugin in MariaDB 10.1 and before instead of XtraDB. See Using InnoDB instead of XtraDB. => 10.2.x 버전부터 MariaDB도 XtraDB가 아니라 innodb를 default로 사용한다.
#my.cnf 수정후 다시 설치해본다.
[root@testdb]# ./mysql_install_db --user=mysql --defaults-file=/etc/my.cnf --basedir=/home/mysql/mariadb --datadir=/home/mysql/mariadb_data
Installing MariaDB/MySQL system tables in '/data/svc/mariadb_data' ... OK
To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER ! To do so, start the server, then issue the following commands:
'/data/svc/mariadb/bin/mysqladmin' -u root password 'new-password' '/data/svc/mariadb/bin/mysqladmin' -u root -h 172.31.8.62 password 'new-password'
Alternatively you can run: '/data/svc/mariadb/bin/mysql_secure_installation'
which will also give you the option of removing the test databases and anonymous user created by default. This is strongly recommended for production servers.
See the MariaDB Knowledgebase at http://mariadb.com/kb or the MySQL manual for more instructions.
You can start the MariaDB daemon with: cd '/data/svc/mariadb' ; /data/svc/mariadb/bin/mysqld_safe --datadir='/data/svc/mariadb_data'
You can test the MariaDB daemon with mysql-test-run.pl cd '/data/svc/mariadb/mysql-test' ; perl mysql-test-run.pl
Please report any problems at http://mariadb.org/jira
The latest information about MariaDB is available at http://mariadb.org/. You can find additional information about the MySQL part at: http://dev.mysql.com Consider joining MariaDB's strong and vibrant community': https://mariadb.org/get-involved/
[root@testdb]#
# 잘된다ㅎㅎ
#시작 스크립트 작성 ln -s /home/mysql/mariadb/support-files/mysql.server /home/mysql/mariadb/bin/ ln -s /home/mysql/mariadb/bin/mysql.server /etc/init.d/mysqld
[root@testdb]# service mysqld start Starting MariaDB.180521 16:16:34 mysqld_safe Logging to '/home/mysql/mariadb_logs/error/mysql.err'. 180521 16:16:34 mysqld_safe Starting mysqld daemon with databases from /home/mysql/mariadb_data .. [ OK ]
#보안설정
[root@testdb]# cd /home/mysql/mariadb/bin
[root@testdb]# ./mysql_secure_installation --basedir=/home/mysql/mariadb
print: /home/mysql/mariadb/bin/my_print_defaults
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current password for the root user. If you've just installed MariaDB, and you haven't set the root password yet, the password will be blank, so you should just press enter here.
Enter current password for root (enter for none): ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) Enter current password for root (enter for none): [그냥 엔터누른다] OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB root user without the proper authorisation.
Set root password? [Y/n] y New password: Re-enter new password: Password updated successfully! Reloading privilege tables.. ... Success! By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB 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? [Y/n] 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? [Y/n] y ... Success!
By default, MariaDB 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? [Y/n] 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? [Y/n] y ... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MariaDB installation should now be secure.
Thanks for using MariaDB!
[root@testdb]# cd /home/mysql/mariadb/bin [root@testdb]# cp my_print_defaults mysql mysql_config mysqladmin mysqlbinlog mysqlcheck mysqldump mysqlimport mysqlshow mysqlslap /usr/bin [root@bin]# chown -Rf root.root my_print_defaults mysql mysql_config mysqladmin mysqlbinlog mysqlcheck mysqldump mysqlimport mysqlshow mysqlslap
[root@testdb]# service mysqld stop
#mysql 계정으로 접속
[mysql@testdb]# service mysqld start
#쉘 접속확인
[mysql@testdb]# mysql -uroot -p
|