Mysql Code Samples



Filters


Connect to MySQL database with python mysql connector
kishore_kumar | 1 year, 11 months
# pip install mysql-connector

from mysql import connector
python mysql mysql-connector
Create a user table in MySQL database and insert a row
kishore_kumar | 1 year, 11 months
CREATE TABLE `user` (
    `username` VARCHAR(25) NOT NULL,
    `email` VARCHAR(150) NOT NULL,
mysql
Creating table using MySQLi Procedural procedure
Reshma | 1 year, 7 months
<?php
$servername = "localhost";
$username = "username";
mysqli table creation mysql
Changing MySQL User Password Using The SET PASSWORD Statement
Reshma | 1 year, 7 months
SET PASSWORD FOR 'user' @ 'localhost' = new_password;
mysql set password
Creating table using MySQLi Object-oriented Procedure
Reshma | 1 year, 7 months
<?php
$servername = "localhost";
$username = "username";
mysqli table creation mysql
Changing MySQL User Password Using UPDATE Statement
Reshma | 1 year, 7 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
How to copy a table from one database to another database in PostgreSQL?
Reshma | 1 year, 3 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
MySQL | DATABASE() and CURRENT_USER() Functions
Reshma | 1 year, 7 months
SELECT DATABASE();

SELECT CURRENT_USER();
mysql current user database
MySQL | CREATE USER Statement (creating more than one user)
Reshma | 1 year, 7 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 | 1 year, 7 months
ALTER USER user@localhost IDENTIFIED BY 'new_password';
alter password mysql
Next