Search
 
SCRIPT & CODE EXAMPLE
 

SQL

how to connect to xampp sql server on windows cmd

cd c:xamppmysqlin
mysql.exe -u root --password
Comment

connect xampp mysql on cmd windows

To access SQL via the command line we simply navigate to the xampp folder. the folder is usually on the c: drive.

type: cd c:xamppmysqlin then press enter.
type: in mysql -u root -p then press enter.
in the new line enter the password of the database.
type: show databases; to see all the databases that you have access to.
once you know what database you want to use type (ex. cms_database), type use cms_data or any other db_name, it should say Database changed
// Bonus Note you shouldn't use the root user when working with databases. you would want to create a separate account (ex. cms_user) with special privileges to limit errors.

to do that type:

GRANT ALL PRIVILEGES IN cms_database.*
TO 'cms_user'@'localhost' 
IDENTITIED BY 'yourpassword'
double check by using the command:

SHOW GRANT FOR 'cms_user'@localhost;
if you already have the name of the user and the specific database you wish to use, change step 2 to this.

mysql -u cms_user -p cms_database 
Comment

PREVIOUS NEXT
Code Example
Sql :: sql count null 
Sql :: psql get table data types 
Sql :: postgres cast as currency format 
Sql :: oracle convert int to date 
Sql :: how to drop all tables in postgresql 
Sql :: @sqlresultsetmapping 
Sql :: postgres list all triggers 
Sql :: drop index in sql 
Sql :: declare variables sql 
Sql :: DROP TABLes regardless of constraints 
Sql :: run sql command line download for windows 10 
Sql :: create table in microsoft sql server 
Sql :: script sql backup database sql server 
Sql :: postgresql distinct 
Sql :: Mysql Create table with foreign keys. 
Sql :: delete row psql 
Sql :: oracle remove line breaks 
Sql :: sql calculate working days between two dates excluding weekends and holidays 
Sql :: how to check table exists or not in postgresql 
Sql :: sql pad left 0 
Sql :: find the median in sql 
Sql :: RowDataPacket 
Sql :: what is delimiter in mysql 
Sql :: linq join 
Sql :: how to select distinct in mysql 
Sql :: sql update statement 
Sql :: SQL ORDER BY ASC (Ascending Order) 
Sql :: average sql 
Sql :: alter column set not null to null postgres 
Sql :: regexp in mysql 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =