Mysql Code Samples



Filters


How to copy a table from one database to another database in PostgreSQL?
Reshma | 4 years, 5 months
pg_dump -U user1 db_name_old_db | psql -U user2 db_name_target_db
It should be trigger in command prompt not from SQL tool
database postgresql copy table
Connect to MySQL database with python mysql connector
kishore_kumar | 5 years
# pip install mysql-connector

from mysql import connector
python mysql mysql-connector
Changing MySQL User Password Using The SET PASSWORD Statement
Reshma | 4 years, 8 months
SET PASSWORD FOR 'user' @ 'localhost' = new_password;
mysql set password
Create a user table in MySQL database and insert a row
kishore_kumar | 5 years
CREATE TABLE `user` (
    `username` VARCHAR(25) NOT NULL,
    `email` VARCHAR(150) NOT NULL,
mysql
MySQL | DATABASE() and CURRENT_USER() Functions
Reshma | 4 years, 8 months
SELECT DATABASE();

SELECT CURRENT_USER();
mysql current user database
Creating table using MySQLi Procedural procedure
Reshma | 4 years, 8 months
<?php
$servername = "localhost";
$username = "username";
mysqli table creation mysql
Creating table using MySQLi Object-oriented Procedure
Reshma | 4 years, 8 months
<?php
$servername = "localhost";
$username = "username";
mysqli table creation mysql
Changing MySQL User Password Using UPDATE Statement
Reshma | 4 years, 8 months
UPDATE USER SET AUTHENTICATION_STRING = PASSWORD (NEW_PASSWORD) 
WHERE USER = 'USER_NAME' AND
HOST
The FLUSH PRIVILEGES statement needs to be executed after executing the UPDATE Statement. The FLUSH
password changing using update mysql
MySQL | CREATE USER Statement (creating more than one user)
Reshma | 4 years, 8 months
CREATE USER
'user_name' @ 'localhost' IDENTIFIED BY 'password',
'user_name' @ 'localhost' IDENTIFI
creating multiple users mysql
Changing MySQL User Password Using The ALTER USER statement
Reshma | 4 years, 8 months
ALTER USER user@localhost IDENTIFIED BY 'new_password';
alter password mysql
Next