Create a dump file of a table:
mysqldump -c -u user -ppassword database tabel > filename.sql
(no space after p and password)
Push the data of dump file into MySQL database
mysql --verbose --user=XXXXXXXX --password=XXXXXXXX DB_NAME < /PATH/TO/DUMPFILE.SQL
Both these commands need to run from the command prompt and on the machine hosting the database.
Monday, November 16, 2009
Tuesday, November 10, 2009
Wednesday, September 30, 2009
MS SQL Server 2008 Database mail configuration
http://blog.sqlauthority.com/2008/08/23/sql-server-2008-configure-database-mail-send-email-from-sql-database/
Wednesday, September 23, 2009
Import data from csv file into MySQL table
Syntex can be run from MySQL Query Browser:
LOAD DATA LOCAL INFILE 'c:/a.csv' INTO TABLE neighborhood_boundary_Data fields terminated by ',' lines terminated by '\r\n' (neighborhoodid, lat, lon, zz, mm, state, county, city, name, regionid);
[Fields Terminated by ',']: This will be the character used in the CSV file for separating the data
[Lines Terminated by '\r\n']: I put \r to eliminate the enter key
With this particualr table I had an issue, the neighborhoodid field was having duplicate entries (in a MySQL one field with type integer is required to make it a index field) so when I was importing the data it was getting stuck when the value for neighborhoodID field was repeating, so I created an extra field in the table RecID with type integer and was indexed field and did not included that field in the list of fields in the Load data command and it worked.
LOAD DATA LOCAL INFILE 'c:/a.csv' INTO TABLE neighborhood_boundary_Data fields terminated by ',' lines terminated by '\r\n' (neighborhoodid, lat, lon, zz, mm, state, county, city, name, regionid);
[Fields Terminated by ',']: This will be the character used in the CSV file for separating the data
[Lines Terminated by '\r\n']: I put \r to eliminate the enter key
With this particualr table I had an issue, the neighborhoodid field was having duplicate entries (in a MySQL one field with type integer is required to make it a index field) so when I was importing the data it was getting stuck when the value for neighborhoodID field was repeating, so I created an extra field in the table RecID with type integer and was indexed field and did not included that field in the list of fields in the Load data command and it worked.
Tuesday, September 8, 2009
Adding Webpart from Add a web part does not shows it on the page
http://office.microsoft.com/en-us/sharepointserver/HA011605831033.aspx
# On the page that you want to edit, click Edit Page in the Actions list.
# At the top of the page in the shared view, click Modify Shared Page to modify the shared view.
To add Web Parts to your personal view without affecting the view of other users, click Modify My Page from the personal view.
Note The text for the link at the top of the page changes depending upon whether you are looking at the shared view or the personal view.
# Point to Add Web Parts.
# To add a Web Part from an existing Web Part library, click Browse.
The page opens in design mode, and the Add Web Parts pane appears.
# In the Add Web Parts pane, click the library you want to browse.
# In the Web Part List, find the Web Part you want. Click Next to view more Web Parts.
# To find the Web Part you want without browsing through all of the Web Part libraries, click Search after pointing to Add Web Parts.
# In the Search text box that appears in the Add Web Parts pane, type a word describing the Web Part for which you are looking, and then click Go.
A list of Web Parts matching the search appears in the Add Web Parts pane.
# On the page that you want to edit, click Edit Page in the Actions list.
# At the top of the page in the shared view, click Modify Shared Page to modify the shared view.
To add Web Parts to your personal view without affecting the view of other users, click Modify My Page from the personal view.
Note The text for the link at the top of the page changes depending upon whether you are looking at the shared view or the personal view.
# Point to Add Web Parts.
# To add a Web Part from an existing Web Part library, click Browse.
The page opens in design mode, and the Add Web Parts pane appears.
# In the Add Web Parts pane, click the library you want to browse.
# In the Web Part List, find the Web Part you want. Click Next to view more Web Parts.
# To find the Web Part you want without browsing through all of the Web Part libraries, click Search after pointing to Add Web Parts.
# In the Search text box that appears in the Add Web Parts pane, type a word describing the Web Part for which you are looking, and then click Go.
A list of Web Parts matching the search appears in the Add Web Parts pane.
Friday, September 4, 2009
How to change password policy in Membership API
How to enforce strong passwords using membership You can strengthen user password requirements by configuring the attributes minRequiredPasswordLength, minRequiredNonAlphanumericCharacters, and passwordStrengthRegularExpression on your membership provider configuration.
If you are using the SqlMembershipProvider, the default password strength is set to a minimum password length of 7 characters with at least one non-alphanumeric character.
If you are using the ActiveDirectoryMembershipProvider with Active Directory, your domain password policy is used by default, although you can further strengthen password policy by overriding this with your membership configuration by using the attributes listed earlier.
Similarly, if you are using ActiveDirectoryMembershipProvider with ADAM, your local password policy is used, although you can override this with your membership configuration.
=========================
By default membership provider in .net has a password policy that restricts you to have passwords of length 7 (at least) and one character among those 7 must be Alph-Numeric. There are various conditions that you want to overlook this policy. Following are the ways:
Using minimum length and non-alphanumeric character (replace curly bracket with <>)
(membership ...)
(providers)
(add minRequiredPasswordLength=5 minRequiredNonalphanumericCharacters=0 /)
(/providers)
(/membership)
A good article on understanding advanced properties of Membership: http://4guysfromrolla.com/articles/052009-1.aspx
If you are using the SqlMembershipProvider, the default password strength is set to a minimum password length of 7 characters with at least one non-alphanumeric character.
If you are using the ActiveDirectoryMembershipProvider with Active Directory, your domain password policy is used by default, although you can further strengthen password policy by overriding this with your membership configuration by using the attributes listed earlier.
Similarly, if you are using ActiveDirectoryMembershipProvider with ADAM, your local password policy is used, although you can override this with your membership configuration.
=========================
By default membership provider in .net has a password policy that restricts you to have passwords of length 7 (at least) and one character among those 7 must be Alph-Numeric. There are various conditions that you want to overlook this policy. Following are the ways:
Using minimum length and non-alphanumeric character (replace curly bracket with <>)
(membership ...)
(providers)
(add minRequiredPasswordLength=5 minRequiredNonalphanumericCharacters=0 /)
(/providers)
(/membership)
A good article on understanding advanced properties of Membership: http://4guysfromrolla.com/articles/052009-1.aspx
Thursday, September 3, 2009
VSTS 2008 could not find Source safe plug-in
Download and install this:
"http://www.microsoft.com/downloads/details.aspx?familyid=0ED12659-3D41-4420-BBB0-A46E51BFCA86&displaylang=en"
http://social.msdn.microsoft.com/Forums/en-US/vssourcecontrol/thread/50ec5dfa-4e6b-4a43-9b19-733eac4a72cd
"http://www.microsoft.com/downloads/details.aspx?familyid=0ED12659-3D41-4420-BBB0-A46E51BFCA86&displaylang=en"
http://social.msdn.microsoft.com/Forums/en-US/vssourcecontrol/thread/50ec5dfa-4e6b-4a43-9b19-733eac4a72cd
IIS not serving index.php as default page
Create a web.config file in your application directory
Paste this in the web.config, reset IIS and it works
configuration
system.webServer
defaultDocument
files
add value="index.php" /
/files
/defaultDocument
/system.webServer
/configuration
http://www.ozzu.com/programming-forum/tutorial-how-install-php-and-mysql-iis-t56303.html
Paste this in the web.config, reset IIS and it works
configuration
system.webServer
defaultDocument
files
add value="index.php" /
/files
/defaultDocument
/system.webServer
/configuration
http://www.ozzu.com/programming-forum/tutorial-how-install-php-and-mysql-iis-t56303.html
Thursday, August 27, 2009
Web app cannot send emails, SMTP error
Web app running on a different machine (Windows 2008 Server) and the Exchange 2007 is configured on a different machine and the webapp is not able to send out the mails (error:), if the To, CC, BCC and From are of the same domain its sending out but not to the outside domains, to do that need to update the Connector at Exchange to allow this machine on Webapp is running and after that Webapp was able to send out the emails to other domains.
Notes:
Generally it occurs when you have a mail server (e.g. mailserver.com) from one domain, and the addresses are from other domains. Either the From or the To address need to belong to the domain (myname@mailserver.com or yourname@mailserver.com). If neither of the addresses belong to a domain that the mail server 'owns', then you are relaying, which is a spam technique and is generally not allowed nowadays.
Unless you need to receive mail back, you can have the From address be a made-up address within the mail server's domain since you don't need to check it.
Notes:
Generally it occurs when you have a mail server (e.g. mailserver.com) from one domain, and the addresses are from other domains. Either the From or the To address need to belong to the domain (myname@mailserver.com or yourname@mailserver.com). If neither of the addresses belong to a domain that the mail server 'owns', then you are relaying, which is a spam technique and is generally not allowed nowadays.
Unless you need to receive mail back, you can have the From address be a made-up address within the mail server's domain since you don't need to check it.
Wednesday, August 26, 2009
Publishing RS Report on Sharepoint
TargetDataSourceFolder: URL of the Sharepoint library for shared data sources, e.g. http://servername/Shared Documents/Data Source
TargetReportFolder: URL of the Sharepoint Library for reports, e.g. http:servername/Shared Documents/Report Folder
TargetServerURL: URL of the Sharepoint site to which the project is deployed, e.g. http://servername
http://192.168.20.200/systems/Data Connections
TargetReportFolder: URL of the Sharepoint Library for reports, e.g. http:servername/Shared Documents/Report Folder
TargetServerURL: URL of the Sharepoint site to which the project is deployed, e.g. http://servername
http://192.168.20.200/systems/Data Connections
Creating KPI on the Report Center Dashboard
http://office.microsoft.com/en-us/sharepointserver/HA100800271033.aspx
Tuesday, August 25, 2009
Issues faced while integrating Reporting Services with Sharepoint
Download and install Reporting Services Add-in for Sharepoint Technologies
[http://www.microsoft.com/downloads/details.aspx?familyid=200FD7B5-DB7C-4B8C-A7DC-5EFEE6E19005&displaylang=en]
After install open Central Administration, under Reporting Services section, you should see the following links: Manage integration settings, Grant database access, Set server defaults.
[http://mosshowto.blogspot.com/2009/01/integrating-ssrs-2008-sharepoint-2007.html]
To activate Reporting Services integration on a Site Collection
1. Click Start, click Administrative Tools, and then click SharePoint 3.0 Central Administration.
2. Click Site Actions.
3. Click Site Settings.
4. Click Site Collection Features.
5. Find Report Server Integration Feature in the list.
6. Click Activate.
STSADM can also be used to forcefully activate the RS features if there is some issue with provisioning
stsadm -o activatefeature -name Reporting -url http://[server]/[sitecollection]/ -force
[http://www.microsoft.com/downloads/details.aspx?familyid=200FD7B5-DB7C-4B8C-A7DC-5EFEE6E19005&displaylang=en]
After install open Central Administration, under Reporting Services section, you should see the following links: Manage integration settings, Grant database access, Set server defaults.
[http://mosshowto.blogspot.com/2009/01/integrating-ssrs-2008-sharepoint-2007.html]
To activate Reporting Services integration on a Site Collection
1. Click Start, click Administrative Tools, and then click SharePoint 3.0 Central Administration.
2. Click Site Actions.
3. Click Site Settings.
4. Click Site Collection Features.
5. Find Report Server Integration Feature in the list.
6. Click Activate.
STSADM can also be used to forcefully activate the RS features if there is some issue with provisioning
stsadm -o activatefeature -name Reporting -url http://[server]/[sitecollection]/ -force
Friday, August 21, 2009
While activating Publishing Infrastructure at Site collection level Access is Denied error is coming
Solution:
1) Application Pool identity of the current website does not have the full permissions, to clear this open IIS and change the App pool identity to the App pool identity of the Central Admin and then Activate the Publishing Infrastructure and then change the app pool identity back to the old one.
Help from:
http://dotnetdreamer.com/2009/04/27/access-denied-activating-microsoft-office-server-publishing-infrastructure/
Solution 1:
Run the following command
stsadm -o activatefeature -name PublishingResources -url
Solution 2:
After some analysis, I found out that the AppPool for the current web application is having limited privileges. I did the following steps to resolve the problem
1. Open IIS. Locate the Web Applications. Go to properties. Select the Home Directory tab. Change the Application Pool to the one used by the Central Administration
2. Do IISRESET
3. Go to the Site Collection Features (Open SharePoint 3.0 Central Administration, click on "Site Actions" and click on "Site Settings" and then click on "Site Collection Features"). Activate the feature. Now it gets activated!
4. Go to IIS. Change the Application pool of the web application to the original one.
5. Do IISRESET
6. Now go back and create the Report Cente Site
1) Application Pool identity of the current website does not have the full permissions, to clear this open IIS and change the App pool identity to the App pool identity of the Central Admin and then Activate the Publishing Infrastructure and then change the app pool identity back to the old one.
Help from:
http://dotnetdreamer.com/2009/04/27/access-denied-activating-microsoft-office-server-publishing-infrastructure/
Solution 1:
Run the following command
stsadm -o activatefeature -name PublishingResources -url
Solution 2:
After some analysis, I found out that the AppPool for the current web application is having limited privileges. I did the following steps to resolve the problem
1. Open IIS. Locate the Web Applications. Go to properties. Select the Home Directory tab. Change the Application Pool to the one used by the Central Administration
2. Do IISRESET
3. Go to the Site Collection Features (Open SharePoint 3.0 Central Administration, click on "Site Actions" and click on "Site Settings" and then click on "Site Collection Features"). Activate the feature. Now it gets activated!
4. Go to IIS. Change the Application pool of the web application to the original one.
5. Do IISRESET
6. Now go back and create the Report Cente Site
Tuesday, August 18, 2009
How to store the result of a SQL query run by SQLCMD and store that in a command variable
For achieving this we can direct the output of the SQLCMD run to a text file and then store the output of this text file in a command variable
sqlcmd -d database -E -Q"set nocount on; select field from table where field = 'value'" -h -1 > tmp.txt
Now store the result in a text file
set /P mySessionID= < tmp.txt
echo mySessionID
sqlcmd -d database -E -Q"set nocount on; select field from table where field = 'value'" -h -1 > tmp.txt
Now store the result in a text file
set /P mySessionID= < tmp.txt
echo mySessionID
How to set type of Command prompt variable to numeric
In my batch file script I need to read a value stored in a text file into a variable and then do a comparison like (equals, greater, less etc.) but with the following syntax I was not able to as the variable created by Set command was setting the type of this variable as text whereas for comparison of numbers I need to set the type of this variable as numeric.
Original syntax:
set /P mySessionID= < tmp.txt
Putting the variable between % fixed the issue:
set /P %mySessionID%= < tmp.txt
For comparision following are the comparision operators which can be used in a Batch file with If statement:
Operator Meaning
EQU equal to
NEQ not equal to
LSS less than
LEQ less than or equal to
GTR greater than
GEQ greater than or equal to
Original syntax:
set /P mySessionID= < tmp.txt
Putting the variable between % fixed the issue:
set /P %mySessionID%= < tmp.txt
For comparision following are the comparision operators which can be used in a Batch file with If statement:
Operator Meaning
EQU equal to
NEQ not equal to
LSS less than
LEQ less than or equal to
GTR greater than
GEQ greater than or equal to
Wednesday, August 12, 2009
Get Exit code from a command line application
To get a Exit code from a command line application (in my case Unison for replication of files between Windows and Linux boxes), type this command after the unison run is completed:
c:\>echo %errorlevel%
Unison provides four exit codes:
* 0: successful synchronization; everything is up-to-date now.
* 1: some files were skipped, but all file transfers were successful.
* 2: non-fatal failures occurred during file transfer.
* 3: a fatal error occurred, or the execution was interrupted.
c:\>echo %errorlevel%
Unison provides four exit codes:
* 0: successful synchronization; everything is up-to-date now.
* 1: some files were skipped, but all file transfers were successful.
* 2: non-fatal failures occurred during file transfer.
* 3: a fatal error occurred, or the execution was interrupted.
How to use SQLCMD to run a sql command from command prompt
As a default SQLCMD uses windows authentication for connecting to the SQL Server, if running it from the same machine on which SQL Server is installed then there is no need to give the -S [Server name \ instance name] and login credentials.
To run a script create the SQL in a text file rename that to .sql and can be run using this command on the machine hosting SQL Server:
USE Advantureworks;
GO
select * from clients
GO
After that from the command prompt run this command:
c:\>sqlcmd -i C:\myscript.sql -o c:\result.txt
This command will invoke SQLCmd and using windows authentication connect to the default instance of SQL Server, run the query stored in the MyScript.sql file and will store the result in the Result.txt file.
To run a script create the SQL in a text file rename that to .sql and can be run using this command on the machine hosting SQL Server:
USE Advantureworks;
GO
select * from clients
GO
After that from the command prompt run this command:
c:\>sqlcmd -i C:\myscript.sql -o c:\result.txt
This command will invoke SQLCmd and using windows authentication connect to the default instance of SQL Server, run the query stored in the MyScript.sql file and will store the result in the Result.txt file.
Tuesday, August 11, 2009
ntdsapi.dll not found
Boot the computer in Recovery mode, go to recovery console and copy the ntdsapi.dl_ file from the cddrive:\i386\ folder to windows\system32, don't expand the file but use copy command for copying the file something like this:
copy d:\i386\ntdsapi.dl_ c:\windows\system32\ntdsapi.dll
copy d:\i386\ntdsapi.dl_ c:\windows\system32\ntdsapi.dll
Monday, August 10, 2009
To change various settings for password Complexity
1) Run gpmc.msc
2) Expand the domain
3) Go to "Group Policy Objects" and select "Default Domain Policy"
4) Click on Settings Tab on the left side pane and click on Expand: "Computer Configurations" "Policies" "Windows Settings" "Security Settings" "Account Policies" "Password Policy"
5) Right click and select Edit
2) Expand the domain
3) Go to "Group Policy Objects" and select "Default Domain Policy"
4) Click on Settings Tab on the left side pane and click on Expand: "Computer Configurations" "Policies" "Windows Settings" "Security Settings" "Account Policies" "Password Policy"
5) Right click and select Edit
Friday, August 7, 2009
Fundamental difference between Visual Source Safe (VSS) and VSTS Team Foundation
http://bytes.com/topic/net/insights/682758-fundamental-difference-between-visual-source-safe-vss-vsts-team-foundation
Wednesday, August 5, 2009
The database version (C.0.8.40) does not match your reporting services installation
While configuring Reporting Services, this error came when I was configuring the database, reason was I installed SQL SP2 before installing RS, solution was to reinstall SQL 2005 SP2 and it worked.
Monday, August 3, 2009
Change the USB drive capacity
"How to format the USB/Pen drive to a different capacity"
When I need to reinstall OS on my Dell PowerVault 745N, I was stuck with the issue of a 64MB USB drive as the only way to boot it with creating a boot image on a 64 MB USB drive, but in this time I could not found a USB drive with a capacity of 64 MB, so I boot a machine (removed the hard disk power connector and put a high capacity (in my case 4 GB USB drive)) with Windows XP bootable cd, after it loaded all the installable files in the RAM, at this time it detected the USB Drive and asked me if I want to create a partition on it, I said yes and created a partition of 64MB, after this I turned the power off of the machine, took out the USB Drive and put it in another PC, format it and voila I have my 64MB USB Drive ready.
When I need to reinstall OS on my Dell PowerVault 745N, I was stuck with the issue of a 64MB USB drive as the only way to boot it with creating a boot image on a 64 MB USB drive, but in this time I could not found a USB drive with a capacity of 64 MB, so I boot a machine (removed the hard disk power connector and put a high capacity (in my case 4 GB USB drive)) with Windows XP bootable cd, after it loaded all the installable files in the RAM, at this time it detected the USB Drive and asked me if I want to create a partition on it, I said yes and created a partition of 64MB, after this I turned the power off of the machine, took out the USB Drive and put it in another PC, format it and voila I have my 64MB USB Drive ready.
Friday, July 31, 2009
“Windows Setup experienced an unexpected error. To install Windows, restart the installation.”
While upgrading Windows 2003 with Windows 2008 following error is coming and setup is terminating:
“Windows Setup experienced an unexpected error. To install Windows, restart the installation.”
This was coming on my Dell PowerVault 745N and I found that the System volume (partition on which Windows was installed) is a mirrored dynamic volume and when I break it by right clicking on the system volume displayed in Disk Management under Administrative Tools=>Computer management, up gradation process started. After upgrading the mirror can be re established from the same Disk Management.
“Windows Setup experienced an unexpected error. To install Windows, restart the installation.”
This was coming on my Dell PowerVault 745N and I found that the System volume (partition on which Windows was installed) is a mirrored dynamic volume and when I break it by right clicking on the system volume displayed in Disk Management under Administrative Tools=>Computer management, up gradation process started. After upgrading the mirror can be re established from the same Disk Management.
Subscribe to:
Comments (Atom)