Praleisti ir pereiti prie pagrindinio turinio

Pranešimai

Rodomi įrašai nuo Lapkričio, 2018

MySQL password resset (Ubuntu server 18.04)

1. Stop MySQL: $ sudo service mysql stop  2. Make MySQL service directory:  $ sudo mkdir /var/run/mysqld  3. Give MySQL user permission to write to the service directory:  $ sudo chown mysql: /var/run/mysqld  4. Start MySQL manually, without permission checks or networking:  $ sudo mysqld_safe --skip-grant-tables --skip-networking &  5.  Log in without a password.  $ mysql -u root mysql  6. Update the password for the root user.
 mysql> UPDATE mysql.user SET authentication_string=PASSWORD('YOURNEWPASSWORD') WHERE User='root';
 mysql> EXIT; 
7. Turn off MySQL:  $ sudo service mysql restart

MySQL password resset (Ubuntu server 18.04)

1. Stop MySQL: $ sudo service mysql stop  2. Make MySQL service directory:  $ sudo mkdir /var/run/mysqld  3. Give MySQL user permission to write to the service directory:  $ sudo chown mysql: /var/run/mysqld  4. Start MySQL manually, without permission checks or networking:  $ sudo mysqld_safe --skip-grant-tables --skip-networking &  5.  Log in without a password.  $ mysql -u root mysql  6. Update the password for the root user.
 mysql> UPDATE mysql.user SET authentication_string=PASSWORD('YOURNEWPASSWORD') WHERE User='root';
 mysql> EXIT; 
7. Turn off MySQL:  $ sudo service mysql restart

Enable remote connection to MySQL server (Ubuntu server 18.04)

1. Edit mysql config file:
 $ sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf 

comment out following lines:
#bind-address = 127.0.0.1
#skip-networking 
2. Restart mysql server  $ sudo service mysql restart 
3. Log to mysql and change grand privileges (replace USERNAME and PASSWORD by you credentials):  mysql -u USERNAME -p   mysql> GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'%' IDENTIFIED BY 'PASSWORD' WITH GRANT OPTION; 
 mysql > FLUSH PRIVILEGES; 
4. Now you try connect remotely (replace HOSTNAME to server hostname or ip adress):  $ mysql -u root -p -h HOSTNAME