Como configurar o MySQL no Slackware
Esse artigo fala sobre como configurar o MySQL no Slackware, mas estas configurações se aplicam à qualquer uma das demais distribuições. Não vou entrar em muitos detalhes sobre como instalar, pois o propósito aqui é ensinar como configurar.
Parte 2: Bancos e tabelas iniciais do MySQL
Logue-se com o usuário "mysql" e siga os comandos a baixo:
# su mysql
$ mysql_install_db
Preparing db table
Preparing host table
Preparing user table
Praparing func table
Praparing tables_priv table
Praparing columns_priv table
Installing all prepared tables
040625 12:23:26 /usr/libexec/mysqld: Shutdown Complete . . .
$ exit
# mysqld_safe --user=mysql&
# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL
MySQL SERVERS IN PRODUCTION USE! PLEASE READ EACH
STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the current password for the root user. If you've just installed MySQL, and you haven't set the root password yet, the password will be blank, so you should just press enter here.
Enter current password for root (enter for none): [ENTER]
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MySQL root user without the proper authorization.
Set root password? [Y/n] [Y] Y
New password: (Digite aqui aquela que será a sua senha)
Re-enter new password: (Redigite a senha)
Password updated successfully!
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y
... Success!
Cleaning up...
# su mysql
$ mysql_install_db
Preparing db table
Preparing host table
Preparing user table
Praparing func table
Praparing tables_priv table
Praparing columns_priv table
Installing all prepared tables
040625 12:23:26 /usr/libexec/mysqld: Shutdown Complete . . .
$ exit
# mysqld_safe --user=mysql&
# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL
MySQL SERVERS IN PRODUCTION USE! PLEASE READ EACH
STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the current password for the root user. If you've just installed MySQL, and you haven't set the root password yet, the password will be blank, so you should just press enter here.
Enter current password for root (enter for none): [ENTER]
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MySQL root user without the proper authorization.
Set root password? [Y/n] [Y] Y
New password: (Digite aqui aquela que será a sua senha)
Re-enter new password: (Redigite a senha)
Password updated successfully!
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y
... Success!
Cleaning up...
sprintanderson@oi.com.br
root@localhost:~# mysql -p ******
Enter password:
ERROR 1049 (42000): Unknown database '******'