1
Answer

"Error: Failed to Setup Database MYSQLDB "

Photo of Nithish Reddy

Nithish Reddy

6y
694
1
Hi,  
 
when i am deploying, powershell scripts for automatic web deploy setup, while creation of mysqldatabase , it is genarating an error (i,e) Failed to setup database "mydbsql"
 
 
Can any give me few suggestions  !
 
 

Answers (1)

1
Photo of Amira Bedhiafi
331 5.2k 655k Mar 19

 You need to verify if MySQL is running on your server before executing the script. 

Get-Service | Where-Object {$_.DisplayName -like "*MySQL*"}

If the service is stopped, start it using:

Start-Service -Name "MySQL80"

Also, check if the user executing the script has the necessary privileges to create a database:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;

If you are using a non-root user, grant specific privileges:

GRANT ALL PRIVILEGES ON mydbsql.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword';