Preparation
ssh ascy00224
mkdir -p /infrastructure/agk
mkdir -p /infrastructure/agk/sqldb
mkdir -p /infrastructure/agk/log
mkdir -p /infrastructure/agk/bin
mkdir -p /infrastructure/agk/cnf
CNF File
/infrastructure/agk/cnf/agk.cnf
[server]
user=sys_psggkadm
basedir=/infrastructure/agk/sqldb
datadir=/infrastructure/agk/sqldb/data
socket=/infrastructure/agk/sqldb/socket
port=3306
log-error=/infrastructure/agk/log/mysql.err
pid-file=/infrastructure/agk/mysqld.pid
bind-address = 0.0.0.0
[mysqld]
server_id = 5
binlog_do_db = pice_vnc
log_bin = /infrastructure/agk/log/mysql-bin.log
log_bin_index = /infrastructure/agk/log/mysql-bin.log.index
relay_log = /infrastructure/agk/log/mysql-relay-bin
relay_log_index = /infrastructure/agk/log/mysql-relay-bin.index
binlog_expire_logs_seconds = 864000
max_binlog_size = 100M
log_slave_updates = 1
auto-increment-increment = 2
auto-increment-offset = 1
default_authentication_plugin = mysql_native_password
max_user_connections=3000
max_connections=3000
wait_timeout = 60
key_buffer_size=1500M
thread_cache_size=1500
innodb_buffer_pool_size=6400M
tmp_table_size=150M
innodb_file_per_table
skip-host-cache
skip-name-resolve
lc-messages-dir = /p/psg/ctools/mysql/8.0.20/linux64/share
lc-messages = en_US
Commands
Initialize New Mysql
1.1/p/psg/ctools/mysql/8.0.20/linux64/bin/mysqld --defaults-file=/infrastructure/agk/cnf/agk.cnf --user=sys_psggkadm --initializeserver startup
1.1/p/psg/ctools/mysql/8.0.20/linux64/bin/mysqld --defaults-file=/infrastructure/agk/cnf/agk.cnf --user=sys_psggkadm &server shutdown
2.2/p/psg/ctools/mysql/8.0.20/linux64/bin/mysqladmin shutdown -uroot -p'' -S /infrastructure/agk/sqldb/socketsql shell (to connect to mysql server)
3.3mysql --socket=/infrastructure/agk/sqldb/socket -uroot -p
Step By Step
sudo as sys_psggkadm and ssh ascy00224
on one terminal, run
server startupcommand
1.1 check/infrastructure/agk/log/mysql.err, where temporary password is provided. eg:2026-08-11T05:26:02.042999Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: ly:!i5!jq()Son another terminal, run
sql shellwith the temporary passwordchange password:
ALTER USER 'root'@'localhost' IDENTIFIED BY 'newpw'
FLUSH PRIVILEGES
add new admin user:
CREATE USER 'lionelta'@'%' IDENTIFIED WITH mysql_native_password BY 'abc123';
GRANT ALL PRIVILEGES ON *.* TO 'lionelta'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
Done. You are now able to login as admin with following connection string
>mysql -h ascy00224 -P 3306 -ulionelta -pabc123
No comments:
Post a Comment