Dedicated to providing only the best in technical support for your computing needs.
Serving Los Angeles and Orange County California.

We offer a wide range of services including, but not limited to:

Database Development
Custom Application Design
Website Design
Network Administration

For more information please call Alex Baeza at (714) 906-2539
Or email us at Info@BaezaConsulting.com

Baeza Consulting
Nexcess PDF Print E-mail
Technology questions answered in plain English - *NIX Answers
Written by Alex Baeza   
Tuesday, 09 December 2014 23:13

New Hosting Partner.

Nexcess.

 
Import Data Into MySQL PDF Print E-mail
User Rating: / 2
PoorBest 
Technology questions answered in plain English - Macintosh Answers
Written by Alex Baeza   
Thursday, 13 June 2013 13:56

If you are working with MySQL and need a way to import a flat file into a table in MySQL, this method should always work.

The reason I say it should always work is because depending on if you have access to the machine where MySQL is running, you might be able to import and export files differently.

Since you can't always be guaranteed that the machine where the import file lives is the same machine where the MySQL database files live, stick to using mysqlimport.

 

 

  1. Login to MySQL and create a table that will contain the data that you are about to import.
  2. Rename the import file so that it matches the name of the newly created table (extensions to the filename are ignored)
  3. Run mysqlimport to load the data
Here is a sample command line that tells mysqlimport that the file is local (on my machine) and the database is on some remote host:
$ mysqlimport --host=someremotehost.com --local --port=5363 --user=importman --password=mypassword --lines-terminated-by="\n" --fields-terminated-by="\t" mydatabasename myimport_tablename.importfile.csv
In the above example the filename of the file to be imported is myimport_tablename.importfile.csv. Remember that filename extensions are ignored, so the table name that will be imported into is called myimport_tablename.
Learn more about the mysqlimport program. Read the MySQL documentation to figure out how to interactively enter the password, or to have most of the parameters already specified for you by using a .my.cnf file.
Happy Importing!

Helpful Tips:

Use the following command to help you identify hidden characters used for column separation and line endings:
$ od -c file_to_import.txt |more

 

Use the following command to determine the type of file:

 

$ file file_to_import.txt

 

Use the following command to remove strange characters from a non ascii file:

 

$ iconv -f UTF-16 file_to_import.txt > fixed_file_to_import.txt

Last Updated on Friday, 12 July 2013 16:10
 
Keep a Macbook Running while Closed PDF Print E-mail
User Rating: / 2
PoorBest 
Technology questions answered in plain English - Macintosh Answers
Written by Alex Baeza   
Tuesday, 30 April 2013 15:30

Would you like to be able to keep you macbook running even after you shut the lid?

Would you like to be able to do this without attaching an external monitor or keyboard or mouse?

Would you like to do this without installing any extra softtware?

Are you running OSX 10.7 or better?

Would you like to be able to do this while the power is un-plugged (actually I think you need the power plugged in)?!

We're talking about using your laptop as a headless desktop.

This will allow you to connect to the laptop, share files, share the screen, etc., all with the laptop closed.

Here's how you do it:

 

  1. Open up a terminal (come on, I don't have to explain this do I? google it if you're a noob to the command line)
  2. Type: caffeinate -s
  3. Close the lid
The caffeinate program is included with lion and when you type it in the terminal, it starts a caffeine drip directly into the cpu that keeps the system from going to sleep (giving it a bad case of insomnia).
When you close the lid, the display on the laptop goes black, but the computer stays jittery and ready for your remote requests.
If you want to learn more, check out the man page for caffeinate.
Feel free to put this command into a shell script or some other slick way of executing it (maybe automator?)
If you find a cool way of doing this, send me an email, I'd love to share it.

 

Last Updated on Wednesday, 01 May 2013 08:27
 
«StartPrev12345NextEnd»

Page 1 of 5
 

Login