• MYSQL®

    • If privilege tables are fucked, "mysql_install_db --user=sql".

    • To initially set the root MySQL password, "mysqladmin -u root password 'new-password'".

    • If root password is forgotten :

        1. Stop mysqld and restart it with the --skip-grant-tables --user=root options (Windows users omit the --user=root portion). 2. Connect to the mysqld server with this command: shell> mysql -u root 3. Issue the following statements in the mysql client: mysql> UPDATE mysql.user SET Password=PASSWORD('newpwd') -> WHERE User='root'; mysql> FLUSH PRIVILEGES; Replace .newpwd. with the actual root password that you want to use. 4. You should be able to connect using the new password.

    • Create table : "create table table_name ( field1 VARCHAR(123), field2 VARCHAR (123));"

    • Insert data : "insert into table_name VALUES ('VALUE_1', 'VALUE_2');"

    • Select data : "select * from table_name;"

    • Load data from file : "LOAD DATA LOCAL INFILE '/tmp/file.txt' INTO TABLE table FIELDS terminated by '(delimiter)';"

    • To grant remote users access : "grant all privileges on *.* TO user@ip IDENTIFIED BY 'password' with grant option;
    • To add a user account : mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost' -> IDENTIFIED BY 'some_pass';

  • ORACLE®
  • FREETDS®