Restore db.sql using “Source”

get to bin directory of mysql using command prompt log in to mysql run source command with file parameter Example : cd C:\mysql\bin mysql -u root -p mysql> source c:\myfile.sql https://stackoverflow.com/questions/3021062/how-to-restore-sql-file-generated-by-mysqldump-using-command-prompt  

Can’t Connect to MySQL Server Remotely on Ubuntu

by: devanswers.co MySQL by default will not allow incoming remote connections for security reasons. In this article we will edit the MySQL config file mysqld.cnf to allow remote connections. Testing a Remote MySQL Connection To test a remote MySQL connection in Linux terminal, simply replace username and hostname_or_ip with your own. mysql -u username -h hostname_or_ip -p Or via Command LineContinue reading “Can’t Connect to MySQL Server Remotely on Ubuntu”

Need to generate n rows based on a value in a column t sql

By: gbn I’ll assume MyRef etc is a column in TableA You have a numbers table Something like: SELECT * INTO #TableA FROM ( SELECT 1 AS ID, 3 AS QUANTITY, ‘MyRef’ AS refColumn UNION ALL SELECT 2, 2, ‘AnotherRef’ ) T ;WITH Nbrs ( Number ) AS ( SELECT 1 UNION ALL SELECT 1 +Continue reading “Need to generate n rows based on a value in a column t sql”

Installing MongoDB on Mac

By: STEPHEN KOCH After we had a Processing workshop with Jer Thorpe he got to talking about Mongo, so we decided to have a gander at this “scalable, high-performance, open source, document-oriented database.” Read on for instructions on how to get it operational on your Mac OS X development machine, so you can start playing with Mongo usingContinue reading “Installing MongoDB on Mac”

Prevent Divide-By-Zero Errors in T-SQL

By Sochinda NULLIF(expression, expression) Ex: Column1 / Column2, so when Column2 equal 0 this equation will be error. How to prvent divide by zero error, we have 2 steps as: 1. using NULLIF NULLIF(Column2, 0) : it will return NULL when value equal 0   2. using ISNULL ISNULL(NULLIF(Column2, 0), 1) it will return 1 whenContinue reading “Prevent Divide-By-Zero Errors in T-SQL”

Faceted navigation in PHP and MySQL

By: mightywebdeveloper.com In this tutorial we are going to build a simple PHP/MySQL faceted navigation from scratch. In case you don’t know what faceted navigation is (or faceted search, layered navigation), it’s the nice filtering mechanism you see on most e-commerce sites in some form or another next to the product listing (see image). With eachContinue reading “Faceted navigation in PHP and MySQL”

Install Apache + PHP + MySQL in Ubunut

We can Install Apache, PHP and MySQL in Ubuntu 3 types as bellow: When install Ubuntu Screen, please select ( [x] LAMP SERVER) Go to terminal : sudo apt-get install lamp-server^ Install all application one by one as:   1 Preliminary Note In this tutorial I use the hostname server1.example.com with the IP address 192.168.0.100. These settings mightContinue reading “Install Apache + PHP + MySQL in Ubunut”

Missing Index Feature of SQL Server 2008 Management Studio

By: Ashish Kumar Mehta Problem While looking through the new features and improvements in SQL Server 2008 Management Studio (SSMS) we found a potentially interesting one called Missing Index Hints. Database Developers and Administrators can use Missing Index Hints feature to quickly identify the columns on which adding an index can help running the query faster. Can you give us aContinue reading “Missing Index Feature of SQL Server 2008 Management Studio”