How to Create a Mysql Password for Root

Tyler Tyler (291)
0

If you've just installed MySQL, you will probably want to create a password for the root user.

If you'd like a fuller introduction, check out our introductory guide to PHP and MySQL.

mysql×1

Howchoo is reader-supported. When you buy through links on our site, we may earn a small affiliate commission at no cost to you.

Simply type:

mysqladmin -u root password PASSWORD
where PASSWORD is the password you'd like to use.

Another example:

mysqladmin -u root password 5a0ZI73SU8xk
If you need to generate a password go to random.org or use a password manager like 1Password.

Tyler Tyler (291)
0

If you're using MySQL, at some point you'll want to measure the size of your tables. This can help you identify issues, track table growth over time, estimate disk space requirements, etc.