Joomla and Mysql
Had an interesting problem.
One of my hosted sites lost the mysql database for Joomla, not sure, but it would appear that a sysadmin some how deleted the mysql database, but we did not know this until the user went to their website and found it gone.
Database Error: Unable to connect to the database:Could not connect to MySQL
I take two backups from my cPanel, one via cPanel, and one via my owb backup system.
Therefore I had a copy of the database sitting on my remote backup server.
- Copied back the remote backup.
- Put the Joomla, mysql database back in to /var/lib/mysql
- Set all chmod and chown to correct settings
- Website still gone
- In mysql there is no user or db records for this site/database
- Used this script to create the needed users for this database.
- Replace the'something' with what it should be, every site will be different.
USE mysql;
REPLACE INTO user (host, user, password)
VALUES (
'localhost',
'something_jo151',
-- IMPORTANT: Change this password.
PASSWORD('somethingelse')
);
REPLACE INTO db (host, db, user, select_priv, insert_priv, update_priv, delete_priv,
create_priv, drop_priv, references_priv, index_priv, alter_priv, create_tmp_table_priv,
lock_tables_priv, create_view_priv, show_view_priv, create_routine_priv, alter_routine_priv, execute_priv)
VALUES (
'localhost',
'something\_jo151',
'something_jo151',
'Y', 'Y', 'Y', 'Y',
'Y', 'Y', 'Y', 'Y',
'Y', 'Y', 'Y', 'Y',
'Y', 'Y', 'Y', 'Y'
);
FLUSH PRIVILEGES
My customers site was back.