User:Lethe/mysql

Post install. To initialize the grant tables, use one of the following commands, depending on whether mysql_install_db is located in the bin or scripts directory: $ bin/mysql_install_db --user=mysql $ scripts/mysql_install_db --user=mysql post install. change root user name and password $ mysql -u root mysql> SET PASSWORD FOR ''@'localhost' = PASSWORD('newpwd'); mysql> SET PASSWORD FOR ''@'host_name' = PASSWORD('newpwd'); starting up $ sudo /usr/local/mysql/bin/mysqld_safe --user=mysql & connecting $ /usr/local/mysql/bin/mysql -u lethe -p Show databases $ /usr/local/mysql/bin/mysqlshow -u lethe -p mysql> show databases; select database mysql> use test tables mysql> show tables; mysql> CREATE TABLE pet (name VARCHAR(20), owner VARCHAR(20), species VARCHAR(20), sex CHAR(1), birth DATE, death DATE); mysql> describe pet; editing tables from file (\r line termination for macosx) mysql> LOAD DATA LOCAL INFILE '/path/pet.txt' INTO TABLE pet -> LINES TERMINATED BY '\r'; add one datum to table mysql> INSERT INTO pet -> VALUES ('Puffball','Diane','hamster','f','1999-03-30',NULL); reading a table mysql> SELECT * FROM pet; edit a datum mysql> UPDATE pet SET birth = '1989-08-31' WHERE name = 'Bowser'; shutdown (modify pathname username and put password flag) $ bin/mysqladmin -u root shutdown