debian - Access mysql without password, running as OS root -
is there way user root access mysql
, privileges, without knowing password?
i more used, without being expert, postgresql, , know default debian install of latter can type:
# su - postgres $ psql
i have root access server working on, administrator has not created mysql account me, , not reachable.
considering tamper mysql files, suppose there must way me log in, haven't found yet.
there mysql user, seems doesn't work postgres user:
# su - mysql # whoami root # mysql error 1045 (28000): access denied user 'root'@'localhost' (using password: no)
it has been pointed out not practice, have found way.
mysqld
has command-line switch named --init-file
refers file containing sql commands executed when server starts.
so able create user myself commands:
# echo create user 'scozy'@'localhost' identified '****'; > /root/init.sql # /etc/init.d/mysql stop # mysqld --init-file=/root/init.sql # /etc/init.d/mysql restart
Comments
Post a Comment