DEV Community

Discussion on: Create a database without PhpMyAdmin

Collapse
 
tomekpryjma profile image
Tomek Pryjma

Hi Ben, thanks for the response. I genuinely didn't know that, I was always taught to use either the server's root user or a sudo user so thanks for that!

As for the port, I was writing under the presumption that the port would be the default of 3306 but you're right, there should be a mention of that.

Collapse
 
moopet profile image
Ben Sinclair

If you're running a local MySQL server that's only supposed to be accessed from the same *nix machine you don't need to bind it to a port at all. You can make it listen on a socket like /var/run/mysqld/mysqld.sock and it'll be fine. It's common to run on either or both depending how the server is set up.

There can be odd permissions set up and you can get around not knowing the MySQL root password by running things like mysqladmin as root if I remember correctly, but it's been a long time since I did that and I'm not 100% sure. I know if you search for things like "reset mysql admin password" you can do that as a sudo user without needing any other info.

Thread Thread
 
tomekpryjma profile image
Tomek Pryjma

That is very useful to know, appreciate the info. Going to try those things out for myself.