PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
-- SELECT user, host FROM mysql.user; SHOW DATABASES; SHOW PROCESSLIST; SHOW GRANTS; -- echo "CREATE USER "${domain}"@"localhost" IDENTIFIED BY \"${dbup}\";" | mysql -u root -p"${dbrp}" -- echo "CREATE DATABASE ${domain};" | mysql -u root -p"${dbrp}" -- echo "GRANT ALL PRIVILEGES ON ${domain}.* TO ${domain}@localhost;" | mysql -u root -p"${dbrp}" -- CREATE USER domain @ localhost IDENTIFIED BY dbup; | mysql -u root -p dbrp -- CREATE DATABASE domain; | mysql -u root -p dbrp -- GRANT ALL PRIVILEGES ON domain.* TO domain @localhost; | mysql -u root -p dbrp -- SELECT * FROM information_schema.processlist; -- SELECT ID , user, host, db, command -- FROM information_schema.processlist -- WHERE ID = CONNECTION_ID(); -- CREATE USER IF NOT EXISTS 'emp_read_only'@'localhost' IDENTIFIED BY 'TestPassword'; -- SELECT * FROM mysql.user; -- SELECT user(); -- SELECT current_user(); -- SELECT DATABASE(); DROP TABLE IF EXISTS `student1`; CREATE TABLE `student1` ( `id` int(10) NOT NULL AUTO_INCREMENT, `name` varchar(15) DEFAULT NULL, `sex` char(4) DEFAULT NULL, `address` varchar(20) DEFAULT NULL, `hobby` varchar(30) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `student2`; CREATE TABLE `student2` ( `id` int(10) NOT NULL AUTO_INCREMENT, `name` varchar(15) DEFAULT NULL, `sex` char(4) DEFAULT NULL, `address` varchar(20) DEFAULT NULL, `hobby` varchar(30) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8; CREATE TEMPORARY TABLE student3 ( `id` int(10) NOT NULL AUTO_INCREMENT, `name` varchar(15) DEFAULT NULL, `sex` char(4) DEFAULT NULL, `address` varchar(20) DEFAULT NULL, `hobby` varchar(30) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8; DESC student1; -- SHOW DATABASES; SHOW TABLES; -- use information_schema; -- SHOW TABLES; -- use sakila; -- SHOW TABLES; -- SELECT DATABASE(); /* -- 创建临时表 CREATE TEMPORARY TABLE temp_orders AS SELECT * FROM orders WHERE order_date >= '2023-01-01'; -- 查询临时表 SELECT * FROM temp_orders; -- 插入数据到临时表 INSERT INTO temp_orders (order_id, customer_id, order_date) VALUES (1001, 1, '2023-01-05'); -- 查询临时表 SELECT * FROM temp_orders; -- 删除临时表 DROP TEMPORARY TABLE IF EXISTS temp_orders; */
Copy Clear
Copy Format Clear
<?php try { echo date('Y-m-d H:i:s').PHP_EOL.PHP_EOL; $conn = $mysqli; if($conn->connect_error){ //检测PHP的连接(connect_error字符串有东西吗) die('Connect Failed:'.$conn->connect_error); //报告错误并结束 } echo'Connect success!'.PHP_EOL; echo 'Current script owner: ' . get_current_user(); } catch (mysqli_sql_exception $e) { die ("Error!: " . $e->getMessage() . "<br/>"); } ?>
Show:  
Copy Clear