顯示具有 MySQL 標籤的文章。 顯示所有文章
顯示具有 MySQL 標籤的文章。 顯示所有文章

2017年7月6日 星期四

MySQL latin1亂碼

MySQL匯出
mysqldump -u root -p test > database.sql --default-character-set=latin1
用Emeditor打開,確認編碼後,
轉存UTF-8

2016年12月29日 星期四

Sequelize

Sequelize is a promise-based ORM for Node.js and io.js. It supports the dialects PostgreSQL, MySQL, MariaDB, SQLite and MSSQL and features solid transaction support, relations, read replication and more.
http://docs.sequelizejs.com/en/v3/

2013年7月24日 星期三

MySQL伺服器設定使用mysqld

my.ini內容
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.

[mysqld]

# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M

# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin

# These are commonly set, remove the # and set as required.
basedir = D:/MySQL
datadir = D:/MySQL/data
port = 3306
# server_id = .....
character-set-server = utf8
collation-server = utf8_general_ci


# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M 

sql_mode = NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

Batch啟動檔
cd bin
mysqld --install
net start mysql

Batch停止檔
net stop mysql
bin\mysqld --remove

設定密碼
mysqladmin -u root password YOUR-PASSWORD

修改密碼
cd bin
rem mysqladmin -u root password '123456'
mysql -u root -p
rem use mysql
rem update user set password=PASSWORD('123456') where user='root';

備份資料庫 - 方法1
cd bin
mysqldump test -u root -p > d:\test.sql.bak

備份資料庫 - 方法2
mysqldump -u username -p database --single-transaction >dump.sql

還原資料庫
cd bin
mysql test -u root -p < d:\test.sql.bak
自動安裝
mysqld --install
手動安裝
mysqld --install -manual

2013年5月15日 星期三

舊版UniformServer中PHPMyAdmin密碼錯誤無法連線MySQL問題

Error

MySQL said: Documentation
#1045 - Access denied for user 'root'@'localhost' (using password: YES) 
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.


無解,
1. 內部密碼還原無效。
2. 任何指令都無效。
3. bin內無相關重置用控制執行檔。

解法:
直接複製MySQL的Data到新版UniformServer即可。