Skip to content

Instantly share code, notes, and snippets.

@josdem
Last active June 11, 2024 16:41
Show Gist options
  • Save josdem/b65a7091e400e112c88a to your computer and use it in GitHub Desktop.
Save josdem/b65a7091e400e112c88a to your computer and use it in GitHub Desktop.
//Set mysql root password
mysqladmin -u root password NEWPASSWORD
//Creates a new database
create database {databaseName}
//Show MySQL version from Workbench
SHOW VARIABLES LIKE "%version%";
//Create user
CREATE USER 'jugoterapiaUser'@'localhost' IDENTIFIED BY 'jug0t3DB';
//Grnt all privileges
grant all on vetlog.* to vetlogUser@localhost;
//Granting privileges
grant alter,create,delete,drop,index,insert,select,update,trigger,alter routine,
create routine, execute, create temporary tables on jugoterapia.* to jugoterapiaUser;
//Change password from a user
alter user flywayUser@localhost identified by 'newPassword';
// Create table and Inner Join
create table tbl_1 (value INT);
insert into tbl_1 values (1,2,3,4,5);
select a.value, b.value from tbl_1 a inner join tbl_2 b on a.vaue=b.value;
//Import SQL dump on Windows
use database_name
source path_sql_dump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment