Hello everyone, I need to create a database on a CentOS server using ssh, but I don't own the root account, I'm just an user with sudo capabilities. Is there a command to do this? Or I'll have to ask the server owner to create the db for me? Thanks in advance!
Login to MySQL root account (mysql -uroot will likely work if you didn't set a password) and type the following: CREATE DATABASE `mydatabase`; GRANT ALL PRIVILEGES ON `mydatabase`.* TO `myuser`@`localhost` IDENTIFIED BY 'somepassword'; FLUSH PRIVILEGES; Code (markup): Obviously adjust accordingly.. I would also recommend not using all privileges unless needed.. explicitly set which grants you want (SELECT, UPDATE, etc)