Skip to content

Rocky Linux and Alma Linux config

Huang ziquan edited this page Mar 16, 2024 · 3 revisions

Rocky Linux Alma Linux

#sudo dnf -y upgrade

#sudo dnf install gcc g++
#sudo dnf install libasan
#sudo dnf install cmake
#sudo dnf install brotli brotli-devel
#sudo dnf install gd gd-devel
#sudo dnf -y install boost boost-devel
#sudo dnf -y install openssl openssl-devel

#wget https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64/Packages/q/qrencode-devel-4.1.1-1.el9.x86_64.rpm

#wget https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64/Packages/q/qrencode-libs-4.1.1-1.el9.x86_64.rpm

#rpm -Uvh qrencode-*

https://dev.mysql.com/downloads/

MySQL Yum Repository

https://dev.mysql.com/downloads/repo/yum/

No thanks, just start my download.

#sudo yum install https://dev.mysql.com/get/mysql80-community-release-el9-5.noarch.rpm

#sudo dnf install mysql-devel mysql-community-server

#sudo systemctl start mysqld.service

#sudo systemctl status mysqld

#sudo systemctl enable mysqld

Created symlink /etc/systemd/system/multi-user.target.wants/mysqld.service → /usr/lib/systemd/system/mysqld.service

#mysql --version

#cat /var/log/mysqld.log

find line get root temporary password

[Server] A temporary password is generated for root@localhost: brH0urPZ)adHp

#sudo mysql_secure_installation

Securing the MySQL server deployment.

Enter password for user root: 

The existing password for the user account root has expired. Please set a new password.

New password: 

Re-enter new password: 
The 'validate_password' component is installed on the server.
The subsequent steps will run with the existing configuration
of the component.
Using existing password for root.

Estimated strength of the password: 100(very satisfied with this prompt)
Change the password for root ? ((Press y|Y for Yes, any other key for No) : y

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! 

Example of introducing cppcms database

#wget https://github.com/hggq/paozhu/archive/refs/heads/main.zip
#unzip main.zip
#mv paozhu-main paozhu
#vim paozhu/conf/server.conf

#mysql -u root -p

#create database cppcms default character set utf8mb4 collate utf8mb4_general_ci;
#use cppcms; 
#source /root/paozhu/conf/cppcms.sql;

#use mysql;  
#create user 'cppcms'@'localhost' identified by 'JOcwjSI4Wbdx5R[s@588';  

#GRANT ALL PRIVILEGES ON `cppcms`.* TO 'cppcms'@'localhost'; ALTER USER 'cppcms'@'localhost' ;   

#select host,user,authentication_string from user;  

#exit;  

#vim paozhu/conf/orm.conf

[cms]
type=main
host=127.0.0.1
port=3306
dbname=cppcms
user=cppcms
password=JOcwjSI4Wbdx5R[s@588
pretable=
maxpool=5
dbtype=mysql

type=second
host=127.0.0.1
port=3306
dbname=cppcms
user=cppcms
password=JOcwjSI4Wbdx5R[s@588
pretable=
maxpool=20
dbtype=mysql

#cd paozhu
#unzip asio.zip
#mkdir build

#cd build
#cmake ..
#make