모든 패지지 목록
/var/lib/dpkg/statusDB 삭제
apt-get autoremove --purge mariadb-server
rm -rf /var/lib/mysql
rm -rf /etc/mysql
설치
apt-get install mariadb-server외부 접속 설정
mysql -u root -p
use mysql
grant all privileges on *.* to 'root'@'%' identified by 'password';
flush privileges;
파일 위치 보기
show variables like 'datadir';
mv /var/lib/mysql/ib_logfile0 /var/lib/mysql/ib_logfile0.bak
mv /var/lib/mysql/ib_logfile1 /var/lib/mysql/ib_logfile1.bak
error...
error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'
neo@thematrix:~$ sudo cat /etc/mysql/debian.cnf
The contents of the file should look something like the following:
# Automatically generated for Debian scripts. DO NOT TOUCH!
[client]
host = localhost
user = debian-sys-maint
password = n4aSHUP04s1J32X5
socket = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
user = debian-sys-maint
password = n4aSHUP04s1J32X5
socket = /var/run/mysqld/mysqld.sock
basedir = /usr
See that password? That’s what we’re looking for!
Next, we want to issue a command to MySQL that tells it to grant the
debian-sys-maint
user all necessary privileges using the new password.
Login to your mysql server using your root account and the root password you had originally set:
neo@thematrix:~$ mysql -u root -p
Issue the GRANT command now to grant those permissions:
mysql> GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY 'n4aSHUP04s1J32X5';
Voila! If you restart MySQL, you’ll find that you should no longer be getting the “access denied” error message.
neo@thematrix:~$ sudo /etc/init.d/mysql restart
* Stopping MySQL database server mysqld [ OK ]
* Starting MySQL database server mysqld [ OK ]
* Checking for corrupt, not cleanly closed and upgrade needing tables.
댓글
댓글 쓰기