Mysql remote connection ubuntu

For a remote database setup since MySQL must be able to listen for an external IP address where the server can be reached. To enable this, open up your mysqld.cnf file: sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf It will look like this: . . . lc-messages-dir = /usr/share/mysql skip-external-locking # # Instead of skip-networking the default is now to listen only on…

Read More

    Select Top Percent Records MSSQL, MySQL

    Returning TOP records Microsoft SQL Server – SELECT TOP 10 column FROM table My SQL – SELECT column FROM table LIMIT 10 Returning TOP PERCENT Records Microsoft SQL Server – SELECT TOP 50 PERCENT * FROM table MySQL – SELECT @percentage := ROUND(COUNT(*) * 50/100) FROM table;   PREPARE STMT FROM ‘SELECT * FROM table LIMIT ?’;  EXECUTE…

    Read More