1. Goal
Prepare the database server with correct startup, initial setup, and first operational checks.
2. Files and components involved
/etc/rc.d/rc.mysqld
/etc/my.cnf
/var/lib/mysql
3. Operational flow
mysql_install_db --user=mysql
chown -R mysql:mysql /var/lib/mysql
chmod +x /etc/rc.d/rc.mysqld
/etc/rc.d/rc.mysqld start
4. Operational verification
mysqladmin ping
ss -lntup
grep 3306
mysql -u root -p -e SHOW DATABASES
5. Practical notes
Test the configuration with a file separate from the real site and keep a copy of the previous config.
After changing the configuration, always run a syntax test and open the page from a browser or with curl on localhost.
Quick checklist
[ ] Backup or copy of the existing configuration completed
[ ] Files and commands updated as expected
[ ] Local test completed successfully
[ ] Logs or final output verified
[ ] Rollback procedure documented