Showing posts with label MySQL. Show all posts
Showing posts with label MySQL. Show all posts

Dec 9, 2013

[MySql] External Connection to MySql

mysql -u root -p

input password


mysql>grant all privileges  on *.* to 'root'@'%' identified by 'password';
mysql>flush all privileges;


then restart mysql like  : mysqld restart

if it does not work edit mysql.conf (mysql.ini) and restart.

//bind 127.0.0.1 ---> comment this .

Oct 8, 2013

[MySQL] How to fetch only 10 results from "SELECT"

Oracle, MS-SQL, and MySQL differs slightly. Here is the MySQL version. 
Just add "LIMIT" after selection statement. 

     SELECT nIdx 
        FROM tb_table 
ORDER BY time DESC 
        LIMIT 10;