Advertisement
Guest User

deanet

a guest
Apr 5th, 2009
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.68 KB | None | 0 0
  1. [zie: ~ ]$ nmap localhost
  2.  
  3. Starting Nmap 4.76 ( http://nmap.org ) at 2009-04-05 15:31 WIT
  4. Interesting ports on localhost (127.0.0.1):
  5. Not shown: 994 closed ports
  6. PORT STATE SERVICE
  7. 53/tcp open domain
  8. 80/tcp open http
  9. 139/tcp open netbios-ssn
  10. 445/tcp open microsoft-ds
  11. 3306/tcp open mysql
  12. 9050/tcp open tor-socks
  13.  
  14. Nmap done: 1 IP address (1 host up) scanned in 0.13 seconds
  15. [zie: ~ ]$ mysqladmin -u root password test
  16. mysqladmin: connect to server at 'localhost' failed
  17. error: 'Access denied for user 'root'@'localhost' (using password: NO)'
  18. [zie: ~ ]$ sudo /etc/rc5.d/S19mysql stop
  19. * Stopping MySQL database server mysqld [ OK ]
  20. [zie: ~ ]$ mysqld --skip-grant-tables --skip-networking
  21. 090405 15:33:41 [Warning] Can't create test file /var/lib/mysql/zie.lower-test
  22. 090405 15:33:41 [Warning] Can't create test file /var/lib/mysql/zie.lower-test
  23. 090405 15:33:41 [Warning] One can only use the --user switch if running as root
  24.  
  25. 090405 15:33:41 InnoDB: Operating system error number 13 in a file operation.
  26. InnoDB: The error means mysqld does not have the access rights to
  27. InnoDB: the directory.
  28. InnoDB: File name ./ibdata1
  29. InnoDB: File operation call: 'open'.
  30. InnoDB: Cannot continue operation.
  31. [zie: ~ ]$ sudo mysqld --skip-grant-tables --skip-networking
  32. 090405 15:33:45 InnoDB: Started; log sequence number 0 43655
  33. 090405 15:33:45 [Note] mysqld: ready for connections.
  34. Version: '5.0.75-0ubuntu9' socket: '/var/run/mysqld/mysqld.sock' port: 0 (Ubuntu)
  35.  
  36. [zie: knoppix ]$ mysql -u root
  37. Welcome to the MySQL monitor. Commands end with ; or \g.
  38. Your MySQL connection id is 1
  39. Server version: 5.0.75-0ubuntu9 (Ubuntu)
  40.  
  41. Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
  42.  
  43. mysql> set password for root@'localhost' = password('password');
  44. ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
  45. mysql> update mysql.user set password=password('toor') where user='root';
  46. Query OK, 3 rows affected (0.05 sec)
  47. Rows matched: 3 Changed: 3 Warnings: 0
  48.  
  49. mysql> quit
  50. Bye
  51. [zie: knoppix ]$ mysql -u root
  52. Welcome to the MySQL monitor. Commands end with ; or \g.
  53. Your MySQL connection id is 2
  54. Server version: 5.0.75-0ubuntu9 (Ubuntu)
  55.  
  56. Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
  57.  
  58. mysql> update mysql.user set password=password('toor') where user='root';
  59. Query OK, 0 rows affected (0.00 sec)
  60. Rows matched: 3 Changed: 0 Warnings: 0
  61.  
  62. mysql> flush privileges;
  63. Query OK, 0 rows affected (0.01 sec)
  64.  
  65. mysql> quit
  66. Bye
  67. [zie: knoppix ]$ mysql -u root
  68. ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
  69. [zie: knoppix ]$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement