In my Ubuntu 20.04 (Desktop/Laptop not server) OS based machine I recently install XAMPP (Version: 7.4.7).
Now when I try to create a database it shows #1006 - Can't create database 'database_name' (errno: 13 "permission denied").
I am not quite familiar with Ubuntu in recent times (last use Ubuntu 18.04), so I can't figure out in which file I need to do the configuration or in which directory I need to allow the permission so that the problem is fixed. Can anyone help me to fix the issue?
1 Answer
TO be able to create database you have to login to phpmyadmin as root or with the account that have required permission. first make sue you have started mysql by typeing
$service mysql startTo get started you can create a new user for your mysql. you can do that by
mysql>CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';where newuser is the username. You can set that to the username of your accountwhuch make it easier to work with.and yes localhost is the server you are using and password is the password you want to set for mysql login.
Now you have creates a new user and it's time to make that user capable of doing stuffs. You can do so by
mysql>GRANT ALL PRIVILEGES ON *.* TO 'newuser'@'localhost';here *.*means that we are granting the permission for every table of every database which also meanwe can create if we need. So now you should be able to create database by username newuser Just in case if you need to log into mysql from terminal then do
mysql -u newuser -pDuring this proces I am assuming that you will run all these command as root.