saitgulmez
8/18/2017 - 1:45 PM

MySQL

MySQL

CREATE TABLE table_name (column_name column_type);

tutorials_tbl(
   tutorial_id INT NOT NULL AUTO_INCREMENT,
   tutorial_title VARCHAR(100) NOT NULL,
   tutorial_author VARCHAR(40) NOT NULL,
   submission_date DATE,
   PRIMARY KEY ( tutorial_id )
);


Alter table

your table:
q1 | q2 | q3 | q4 | q5
you can also do

ALTER TABLE yourtable ADD q6 VARCHAR( 255 ) after q5
Let MySQL users create databases, but allow access to only their own databases
CREATE DATABASE dbTest;
GRANT ALL PRIVILEGES ON dbTest.* TO 'user';


CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'some_pass';
grant all privileges on B.* to 'myuser'@'localhost' identified by 'some_pass';

http://web.deu.edu.tr/berent/unix/mysql.html

mysql -u root -p mysql
grant all privileges on DATABASE_NAME.* to USERNAME@localhost identified by 'PASSWORD';
flush privileges;
\q

Question 1) How do I turn off the mysql password validation?
Answer: Here is what I do to remove the validate password plugin:

1. Login to the mysql server as root mysql -h localhost -u root -p
2. Run the following sql command: uninstall plugin validate_password; 
o re-enable it again, use following command: INSTALL PLUGIN validate_password SONAME 'validate_password.so'
OR 
validate_password_policy=LOW;
sudo service mysqld restart
https://stackoverflow.com/questions/36301100/how-do-i-turn-off-the-mysql-password-validation
 
 
Question 2) How to create a user 
https://www.digitalocean.com/community/tutorials/how-to-create-a-new-user-and-grant-permissions-in-mysql