mysql_secure_installation ## 初始化Mysql ## 如下,都选择Y即可,密码等级选择0,然后配置root密码。 Securing the MySQL server deployment. Connecting to MySQL usinga blank password. VALIDATE PASSWORD COMPONENT can be used to test passwords and improve security. It checks the strength of password and allows the users toset 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 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 charactersand dictionary file Please enter 0 = LOW, 1 = MEDIUM and2 = STRONG: 0 Please setthe password for root here. New password: Re-enter new password: Estimated strength ofthe password: 50 Do you wish to continue withthe password provided?(Press y|Y for Yes, any other key for No) : y By default, a MySQL installation has an anonymous user, allowing anyone tologinto MySQL without having to have a user account created for them. This is intended only for testing, andto make the installation go a bit smoother. You should remove them before moving intoa 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 fromthe network. Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y Success. By default, MySQL comes witha database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving intoa production environment. Remove test database and access toit? (Press y|Y for Yes, any other key for No) : y - Dropping test database... Success. - Removing privileges ontestdatabase... 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!
创建数据库导入SQL文件
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
wget https://github.com/AutohomeCorp/frostmourne/blob/master/doc/mysql-schema/frostmourne.sql ## 可能需要挂国际代理,或浏览器下载,使用SCP上传即可. mysql -uroot -p < frostmourne.sql #输入密码即可导入创建数据库。 mysql -uroot -p mysql> show databases; +--------------------+ | Database | +--------------------+ | frostmourne | | information_schema | | mysql | | performance_schema | | sys | +--------------------+ 5 rows in set (9527.01 sec) #查看数据库是否正常创建, quit命令退出。
/opt/frostmourne/scripts/startup.sh ./startup.sh: line7: dos2unix: command not found LOG_DIR: /opt/frostmourne/scripts/../logs PID_FOLDER: /opt/frostmourne/scripts/../pid Sun Mar 2616:42:27 CST 2023 ==== Starting ==== Application is running as root (UID 0). This is considered insecure. Started [5477] Waiting for server startup.. Sun Mar 2616:42:37 CST 2023 Server started in 10 seconds ss -an | grep10054 tcp LISTEN 0100 *:10054 *:* ## 查看10054端口监听即可判断已正常启动。 /opt/frostmourne/scripts/shutdown.sh ## 停止服务