Telegram Group & Telegram Channel
MySQL

Auto insert with TimeStamp
CREATE TABLE test (
id INTEGER,
txt VARCHAR(20),
ts1 TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
ts2 TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

Copy Database
mysqldump -u root -p db1 > dump.sql
mysqladmin -u root -p create db2
mysql -u root -p db2 < dump.sql


Create User
mysql> grant all privileges on DBNAME.* to USERNAME@localhost identified by 'PASSWORD';
mysql> grant all privileges on DBNAME.* to USERNAME@"%" identified by 'PASSWORD';
mysql> flush privileges;


--all DB
mysql> grant all privileges on *.* to USERNAME@localhost identified by 'PASSWORD';
mysql> grant all privileges on *.* to USERNAME@"%" identified by 'PASSWORD';
mysql> flush privileges;


Delete User
mysql> drop user USERNAME;
or
mysql> delete from mysql.user where user = 'USERNAME';


Change Password
--User
mysql> set password for USER@"%" = password('PASSWORD');
mysql> set password for USER@localhost = password('PASSWORD');


--root
mysql> set password for root=password('PASSWORD');
mysql> set password for root@localhost=password('PASSWORD');

CSV Import / Export
ERROR 1045 (28000) at line 1: Access denied for user 'USER'@'localhost' (using password: YES)
mysql> grant file on *.* to USER@localhost;


Tips
--Create table as same data and type
mysql> create table newtable as select * from orgtable;


--Create table with same type. data is null.
mysql> create table newtable as select * from orgtable where id is null;

Export to CSV
# mysql -uUSER -pPASS DATABASE -e "select * from TABLE;" | sed -e 's/^/"/g' | sed -e 's/$/"/g' | sed -e 's/\t/","/g' > /tmp/test.csv



tg-me.com/linux_srv/460
Create:
Last Update:

MySQL

Auto insert with TimeStamp
CREATE TABLE test (
id INTEGER,
txt VARCHAR(20),
ts1 TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
ts2 TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

Copy Database
mysqldump -u root -p db1 > dump.sql
mysqladmin -u root -p create db2
mysql -u root -p db2 < dump.sql


Create User
mysql> grant all privileges on DBNAME.* to USERNAME@localhost identified by 'PASSWORD';
mysql> grant all privileges on DBNAME.* to USERNAME@"%" identified by 'PASSWORD';
mysql> flush privileges;


--all DB
mysql> grant all privileges on *.* to USERNAME@localhost identified by 'PASSWORD';
mysql> grant all privileges on *.* to USERNAME@"%" identified by 'PASSWORD';
mysql> flush privileges;


Delete User
mysql> drop user USERNAME;
or
mysql> delete from mysql.user where user = 'USERNAME';


Change Password
--User
mysql> set password for USER@"%" = password('PASSWORD');
mysql> set password for USER@localhost = password('PASSWORD');


--root
mysql> set password for root=password('PASSWORD');
mysql> set password for root@localhost=password('PASSWORD');

CSV Import / Export
ERROR 1045 (28000) at line 1: Access denied for user 'USER'@'localhost' (using password: YES)
mysql> grant file on *.* to USER@localhost;


Tips
--Create table as same data and type
mysql> create table newtable as select * from orgtable;


--Create table with same type. data is null.
mysql> create table newtable as select * from orgtable where id is null;

Export to CSV
# mysql -uUSER -pPASS DATABASE -e "select * from TABLE;" | sed -e 's/^/"/g' | sed -e 's/$/"/g' | sed -e 's/\t/","/g' > /tmp/test.csv

BY Типичный Сисадмин


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/linux_srv/460

View MORE
Open in Telegram


telegram Telegram | DID YOU KNOW?

Date: |

In many cases, the content resembled that of the marketplaces found on the dark web, a group of hidden websites that are popular among hackers and accessed using specific anonymising software.“We have recently been witnessing a 100 per cent-plus rise in Telegram usage by cybercriminals,” said Tal Samra, cyber threat analyst at Cyberint.The rise in nefarious activity comes as users flocked to the encrypted chat app earlier this year after changes to the privacy policy of Facebook-owned rival WhatsApp prompted many to seek out alternatives.

How Does Bitcoin Mining Work?

Bitcoin mining is the process of adding new transactions to the Bitcoin blockchain. It’s a tough job. People who choose to mine Bitcoin use a process called proof of work, deploying computers in a race to solve mathematical puzzles that verify transactions.To entice miners to keep racing to solve the puzzles and support the overall system, the Bitcoin code rewards miners with new Bitcoins. “This is how new coins are created” and new transactions are added to the blockchain, says Okoro.

telegram from jp


Telegram Типичный Сисадмин
FROM USA