mysql

(Python,MySQL)DBアクセスサンプル

C:\Users\masawa>pip install mysql-connector-python import mysql.connector config = { "host": "localhost", "database": "test_db", "user": "masawa", "password": "masawa" } conn = mysql.connector.connect(**config) cursor = conn.cursor() curso…

(MySQL)CREATE USERからCRATE TABLEまで一連の作業

C:\Users\masawa>mysql -u root -p mysql> create user 'masawa'@'localhost' identified by 'masawa'; Query OK, 0 rows affected (0.01 sec) mysql> select user, host, plugin from mysql.user; +------------------+-----------+-----------------------…

(Node)(JS)NodeからMySQLへ接続

特に何か必要があったわけではないけど,MySQLへ初接続したので記念にメモです. var fs = require('fs'); var mysql = require('mysql'); var db = mysql.createConnection({ host: 'localhost', user: 'root', password: 'mysql', database: 'tatsujin' })…

MySQLメモメモ

起動 $ mysql.server start 終了 $ mysql.server stop パスワードなどの設定 $ mysql_secure_installation rootで接続 $ mysql -uroot -p ユーザ作成・データベース作成 mysql> GRANT ALL PRIVILEGES ON 'データベース名'.* TO 'ユーザ名'@localhost IDENTIF…