기본 콘텐츠로 건너뛰기

설치,삭제, MySQL(Maria DB) root 계정 외부접속 허용

모든 패지지 목록

/var/lib/dpkg/status

DB 삭제


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.

댓글

이 블로그의 인기 게시물

dmesg 메시지 실시간으로 보기

참조사이트 http://imitator.kr/Linux/556 # tail -f /var/log/messages # tail -f |dmesg //기본 2초 단위로 갱신 된다. # watch "dmesg | tail -f" //1초 단위로 갱신하면서 보여준다. # watch -n 1 "dmesg | tail -f" // 보여주는 줄을 20으로 늘린다. (기본 10줄) # watch -n 1 "dmesg | tail -f -n 20"

java 특정 디렉토리에 있는 파일 목록을 읽어내기, 정렬해서 가져오기

폴더 리스트 가져오기 String path="C:\"; File dirFile=new File(path); File []fileList=dirFile.listFiles(); for(File tempFile : fileList) {   if(tempFile.isFile()) {     String tempPath=tempFile.getParent();     String tempFileName=tempFile.getName();     System.out.println("Path="+tempPath);     System.out.println("FileName="+tempFileName);     /*** Do something withd tempPath and temp FileName ^^; ***/   } } 정렬해서 가져오기 import java.io.FileFilter; import java.io.IOException; import java.util.Arrays; import java.util.Date; import org.apache.commons.io.comparator.LastModifiedFileComparator; import org.apache.commons.io.filefilter.FileFileFilter; public class LastModifiedFileComparatorTest { public static void main(String[] args) throws IOException { File directory = new File("."); // get just files, not directories File[] files = directory.listFiles((FileFilter) FileFileFilter.FILE); System.out.println("Defaul...