Moving MySQL Data Directory
In short, I need to quickly create a temporary table of about 500,000+ rows and insert a single character in a new column after all the other columns (regardless of how many there are) and then "select * into outfile" in a data directory in which the user can access. What directory should I write to (the MySQL Data directory? The tmp directory? a separate directory?) and how should I give the correct permissions so that I do not receive a "do not have permissions" error?
- CREATE TEMPORARY TABLE Syntax
- Alter table Syntax (for adding a column)
- INSERT Syntax (for adding the character)
- Export @tempTable to .txt file in SQL server
As long as you export to a folder that is public (such as public_html) the file will be accessible to the world. Typical permissions for a file are "644," see more in our guide on changing file permissions. Thank you, John-Paul