LAMP – Ubuntu 20.04 – Can’t select database
-
These are the steps I followed to install a WordPress locally:
I followed these instructions from STEP 4 as I already had the lamp stack installed.Creating the Apache Server blocks I used this:
<VirtualHost *:80> ServerAdmin jan@localhost DocumentRoot /var/www/html/wordpress/wordpress01/ ServerName wordpress01 ServerAlias wordpress01 <Directory /var/www/html/wordpress/wordpress01/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
After all was said and done I updated my wp-config.php with this:
/** The name of the database for WordPress */ define( 'DB_NAME', 'wordpress01' ); /** MySQL database username */ define( 'DB_USER', 'jan@localhost' ); /** MySQL database password */ define( 'DB_PASSWORD', 'password' ); /** MySQL hostname */ define( 'DB_HOST', 'localhost' ); /** Database Charset to use in creating database tables. */ define( 'DB_CHARSET', 'utf8' ); /** The Database Collate type. Don't change this if in doubt. */ define( 'DB_COLLATE', '' );
And then got the Authentication Unique Keys and Salts and updated those.
$table_prefix = 'wp_';
And then I get this result:
Access denied for user ‘jan@localhost’@’%’ to database ‘wordpress01’
Can’t select database
We were able to connect to the database server (which means your username and password is okay) but not able to select the wordpress01 database.Are you sure it exists?
Does the user jan@localhost have permission to use the wordpress01 database?
On some systems the name of your database is prefixed with your username, so it would be like username_wordpress01. Could that be the problem?I am sure I have taken a wrong turn somewhere, or left something out but I can’t see where.
Please!
- The topic ‘LAMP – Ubuntu 20.04 – Can’t select database’ is closed to new replies.