ドキュメント

MySQL

MySQL has a root user with a blank password. It's enough for local tasks. You may create another user with a password or change the root password using phpMyAdmin (http://localhost:81/) or Adminer (http://localhost:82/).

NB: phpMyAdmin may release some comments on a blank password for root. Do not pay attention to it.

MySQL config is winginx\mysql\my.ini.

Data directory: winginx\mysql\data

To connect to MySQL from PHP use mysql_connect function, then mysql_select_db function.

<?php
mysql_connect('localhost', 'mysql_user', 'mysql_password');
mysql_select_db('db_name');
mysql_set_charset('utf8');
?>

Instead of mysql_user, mysql_password, and db_name you should set real strings: username (in our case, root), password (in our case, too, empty string) and database name (you can create it using phpMyAdmin or Adminer).

Connecting to MySQL from Node.js

var mysql = require('mysql');

var client = mysql.createClient();

client.host = 'localhost';
client.port = '3306';
client.user = 'root';
client.password = '';
client.database = 'test_db';

client.query('SELECT * FROM "test"', function(error, result, fields){

  if (!error){
    // Working with 'result' ...

    // Closing connection
    client.end();
  }

});
Winginx © Alexei Shabalin, 2011-2023