Technology TidBits

Answers to various technical questions on php programming, mysql, linux, and many more categories.



Showing: 1-20 of 31    »»
Questions:
What causes an error 150 when loading data into a mysql database?
This is usually a problem with constraints.  Perhaps the tables aren't being loaded in the right order, etc.  Anyway, I've...
rating 07/03/2009 Comments: 0
How can I display long records in mysql without wrapping?
Often times, you need to view a record with lots of fields, and the default mysql horizontal output makes it...
rating 06/23/2009 Comments: 0
How can I import data in mysql?
A quick example, using a file of tab delimited values, where "contacts.txt" contains a tab delimited file of the values. ...
Not rated 06/25/2009 Comments: 0
How can I get mysql table definitions in my php script?
This will dump all the tables and fields in your database, showing the field types, and other attributes.  Useful for...
Not rated 07/01/2009 Comments: 0
How can I execute commands on mysql using a php script?
Sometimes you want to just execute arbitrary mysql commands on a one time basis against a mysql database.  This little...
rating 07/02/2009 Comments: 0
What causes mysql to give an error 145?
This is a problem with a table or tables being corrupted.  An example error message is: Can't open file: 'cc_pages.MYD'. (errno:...
Not rated 07/02/2009 Comments: 0
How can I add a conditional statement in the field list of my sql statement?
Suppose you are selecting records from a database, and you want to add some logic to the resulting output.  For...
Not rated 06/30/2009 Comments: 0
How can I dump table definitions (with no data) using mysqldump?
Use the following command, changing "--all-databases" if you only want specific databases to be dumped: mysqldump --no-data -u root -p --all-databases...
Not rated 06/21/2009 Comments: 0
How can I manipulate a table with a reserved word as a column name?
It's easy to accidentally create a mysql table with a reserved word in it. Sometimes it happens when you upgrade...
Not rated 06/23/2009 Comments: 0
How can I find out table information in mysql?
Sometimes you need to know some information about a table - like the table type, size, etc. If you run...
rating 06/09/2009 Comments: 0
How can I rename a field in a mysql table?
You can change a field name in an existing table, using the CHANGE keyword:alter table rss_feed change unsubscribe_url referring_url varchar(255)...
rating 07/03/2009 Comments: 3
How can a change a user password in mysql?
Use this format (logged in as root):SET PASSWORD FOR username = PASSWORD('new password');NOTE: make sure you get the exact username...
Not rated 06/30/2009 Comments: 0
How can I reset the auto_increment id field in my table?
First, delete all records in the table (assuming you want to start at 1).  Then run this command:   ALTER TABLE tablename...
Not rated 06/28/2009 Comments: 0
How can I see the syntax used to create a table in mysql?
Use the following command:  SHOW CREATE TABLE [tablename]; This will show you the exact command used to create the table in question,...
Not rated 06/18/2009 Comments: 0
How can I delete or remove a field from a mysql table?
To keep your tables clean and easy to decipher, it's advisable to delete any columns that are no longer used. ...
Not rated 06/30/2009 Comments: 0
What does an error 'Got error 122 from storage engine' mean?
This error generally indicates an issue with disk space on the web server.  The mysql database needs to have space...
Not rated 06/20/2009 Comments: 0
How can I run sql commands from a file or import tables from the mysqldump?
There are two options for running sql commands from a file: 1.  All command line: mysql -u [username] -h [hostname] -p [database]...
Not rated 06/27/2009 Comments: 0
How can I create a CSV file from a query?
It's often useful to make "ad hoc" reports that can be brought into excel or another database as CSV files. ...
Not rated 06/25/2009 Comments: 0
How can I dump selected records using mysqldump?
Sometimes you just need to grab a few records from a table when using mysqldump.  Here's the syntax for doing...
Not rated 07/02/2009 Comments: 0
How can I sum a field in mySQL only if it contains a value?
Sometimes on a query you'd like to tally how many records match a specific criteria, but also pull records that...
Not rated 09/06/2010 Comments: 0



Powered by KnowledgebasePublisher 1.1
Superb Internet
Content provided by Roberts WebForge, Inc.