I've been trying to correctly create a user and database for an hour using the bash script, but I'm still getting error messages. I paste the code below. I will be grateful for your help!
#!/bin/bash
username="useursur"
passworduser="dnfndfvjdngdg"
sudo mysql -u $username -p$passworduser <<EOF
CREATE USER 'wpdb'@'localhost' IDENTIFIED BY 'fsafdasdfsadfasdf';
CREATE DATABASE wpdb;
GRANT ALL PRIVILEGES ON wpdb.* TO 'wpdb';
FLUSH PRIVILEGES;
EOF
I changed the command to
sudo mysql -u $username -p$passworduser -e "CREATE USER 'wpdb'@'localhost' IDENTIFIED BY 'fsafdasdfsadfasdf';CREATE DATABASE wpdb;GRANT ALL PRIVILEGES ON wpdb.* TO 'wpdb';FLUSH PRIVILEGES;"
As a result I get this error:
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1133 (42000) at line 1: Can't find any matching row in the user table