Most Efficient Way Of Storing Data From Multiple Accounts
As part of a system I am putting together I need to allow users to create thier own accounts on my servers. Each user can create their own account, and then have their users register for it. Each account needs it data seperate from the others, a member registered for one account should not be able to view another account and a username registered with one account should still be available to the other accounts.
The ways I have been looking at are:
1. Create a new database for every account created so that all users are kept in seperate databases.
2. Have one table for users, one for topics, one for posts etc and then associate each row within this table with the relevent account. So for example a user could register with the forum with the ID 4, so their user entry would be
Userid: 234
Username: xxxx
Password: xxxx
Forumid: 4
Then when a new member registers with any account I simply check that there is not another user with the same account ID and username. Indexes on relevent fields in this system could help speed up huge tables.
I expect to quickly have 20,000 plus accounts (and in theory it could go up to hundreds of thousands).
I guess my question is which of these methods is better from a speed point of view once we get a large number of accounts and users. Also, are there restrictions on the number of fields in a table that could cause problems?
Using MySQL by the way, on an Apache server.
View Complete Forum Thread with Replies
Related Forum Messages:
The Most Efficient Manner To Update Multiple Rows
I have a table that holds information about people The table is quite large (300,000 rows) I need to write code that update many of the rows in the table Here is what I need to do Two of the fields that I store about each person are: location and country The location is some free text which the user can type in, while the country is the ISO country code, like "US", "ES" and so on I need go over all the records in the database, and for those that have a non-empty location field, to extract the value and to try to guess what country the user is from and to update the Country field accordingly My problem is that I might find that most of the records need updating, and this might lead to 100,00+ update statements I cannot use LOAD DATA as this is product database Is there a way to update multiple rows (each with a different value and condition in a single query?
View Replies !
Efficient SELECT From Multiple Tables With Same Formatting?
Let's say I have 2 tables with the exact same formatting (field/column names, etc) -- the only difference is the name of the tables.. one is called "table1" the other is called "table2" If I wanted to query both of the together is this legal and good coding practice? "SELECT id, headline, permalink, body FROM table2007_11, table2007_12 WHERE id=23" understandly I get this error: Column 'id' in field list is ambiguous" is there a better way to do this than printing out each table name for each field individually? (ie. id. table2007_11, id. table2007_12, etc)?
View Replies !
Moving Data And Accounts When Upgrading
Before upgrading my directory structure looks like: /usr/local/myslq-4.0.21 /usr/local/myslq@ -> mysql-4.0.21 After I install an upgrade it looks like: /usr/local/mysql-4.0.21 /usr/local/mysql-4.1.12 /usr/local/mysql@ -> mysql-4.1.12 The upgrade instructions then say to run "mysql_fix_privilege_tables" but the privilege tables should not need fixing since the only thing in the mysql-4.1.12/data directory are the new "mysql" and "test" databases and they should not need fixing. Also none of my old user accounts and data are there. Am I supposed to do something to copy the old data directory to the new data directory and then fix the privilege tables? Something like "(cd mysql-4.0.21; tar cf -) | (cd mysql-4.1.12; tar xf -)"? Or should my data directory be independent of the mysql directory and used from each installation?
View Replies !
Most Efficient Way To Extract Limited Data
I am currently using the following code, is it the most efficient way to extract and sort the 6 items from the database. The database currently holds over 2,500,000 rows and I want to extract the data as efficiently and quickly as possible. Code:
View Replies !
Storing Multiple Values
I have a table which has a a number of tv stations. There is also a table which is suppose to hold advertisers. An advertiser can subscribe to a specific number of stations. How can I keep track of the variable number of stations that a advertiser can subscribe too? I don't think I can store an array as a field in the advertisers table.
View Replies !
Netware & Storing On Multiple Volumes
By convention, MySQL is installed on the SYS: volume... I know you can move the whole data subdirectory... however can you have the different databases stored on different volumes... windows version uses a "sym" file... is there a similar feature for Netware?
View Replies !
Storing Data
Unfortunately when I was installing FreeBSD, its handbook told me that /var should be around 256 MB or so. Now, since /var is near to the edge of the hdd, it is fast and now I can't store my 2 GB+ mysql data on /var. I'm storing the mysql data on /usr partition which is 60 GB big. Are there any performance implications on my approach ?
View Replies !
Data Storing
As far as I understand numbers are in MySQL database kept as binary. I was wondering how is data in column of type "CHAR" or "TEXT" kept in database: for example if I eneter "Today is Thursday and I do not go to work." in column "CHAR" Is every letter translated into binary ?
View Replies !
BLOB For Storing Data
I'm implementig a java web application using MySQL as database. The main function of the application is basically to redistribuite documents. Those documents (PDF, DOC with an average size around 2Mb) are stored in BLOB column. The amount of documents for the first year should not exceed 5/6 Giga, but I cannot make prevision for the next years. Those documents are mainly just accessed (update and delete are not so common operation) I would like to know if someone else is using a similiar approach. If so, it is scalable?
View Replies !
Storing List Data
How would a set of related values be stored together in a MySQL db? For example, if I wanted to store a user's buddy list, then the way I can think of would be something like this: user | friend John | Jim John | Bob John | Amy Bob | Jim Bob | Amy So John's friendlist would include Jim, Bob, and Amy, and Bob's friendlist would include Jim and Amy. But it seems really inefficient to create a new row every time a new entry in the list is needed I want to be able to store values like this: user | buddylist John | Jim,Bob,Amy Bob | Jim,Amy What would be the most efficient way to do this?
View Replies !
Standards For Storing Data.
I'm looking for some standard guidelines for storing common types of data in MySQL. For example, storing things like telephone numbers as integers vs. varchar, etc. I am NOT looking for tutorials or howtos, just some general information on the most common / effecient ways of handling the sorts of common information.
View Replies !
Storing Calendar Data
I am working on creating an application (in PHP, MySQL, Apache) for ONLINE BOOKING OF MEETING ROOMS in a building.if anyone could let me know how to go about the BACK END design. Basically, how to store calendar data in the database.
View Replies !
Storing Data In Variables
I am trying to get the results from a unix command stored into a field or user variable. I am using the new in version 4 system of ! command. Something like this. mysql> set @pass = ! ~/setpasswd testing ; But it just returns the value to the screen and does not store it in the variable. $1$Q4c8v6rK$hmVLelRR/j6Pabpw2ILUy. The setpasswd script is just a csh script that says openssl passwd -1 $1 Which take input in this case the string "testing" and returns a unix crypt_MD5 salted password.
View Replies !
Storing Binary Data
I am just starting to get into MySQL and PHP. I am using Apache as well. I have read 2 things: You can store binary data in your MySQL database in a BLOB or text type OR you can store binary data on the file system and then store pointers to files in My SQL. I am not all the savvy on the tech talk but I want to know how to do the latter (specifically PDF documents). I have figured out the first way (as there seems to be much more information about this) but I want to know how to do the second version.
View Replies !
Storing Data How It Is Typed
For some reason when a reply is added is doesnt take into account any new lines ie, if someone has pressed enter in their reply to start on a new line, upon it being stored in the database this disappears. So when the response is then viewed it is just one constant paragraph with no breaks. I know this is probably just something simple maybe with how i have the textarea set up or data type in my database.
View Replies !
Storing And Searching Boolean Data
I'm creating a person_profile table and plan to be searching on gender. I'm wondering what the least costly setup is. I'm optimistically assuming there could eventually be millions of rows. I had planned to use a tinyint flag but have learned that creating an index on a boolean type column is ill-advised if not impossible. Would it be more efficient to just have a separate male table and female table? If so, there are other independant, potentially searchable columns in the profile table too that will have only a few (3-10) possible values. Should all of these be broken off into separate tables too? Is there a general percentage rule that you go by? Like, if one value takes up x percentage or more of your index, then an index is not advised?
View Replies !
Data Type For Storing Time
I need to store times in my database. The times will be in the format of 10:15.03 minutes:seconds.milliseconds. Which data type should I select for the field in the table? I will want to be able to sort them into order ie quickest first and also calculate the differences between each time.
View Replies !
Table Sizes And Storing Uploaded Data
I intend to give my website users an option to upload relatively large files via a PHP script. My question is, is it feasible (and a good idea?) to store all the data (potentially several GB) in one table that will then have to be accessed by the server quite heavily at runtime? Alternatives would be to split the table at a certain size threshold or to store just the filenames in MySQL and the corresponding files directly on the HD. Does anyone know how LAMP sites that offer large-scale upload services usually handle this?
View Replies !
Storing A Large Data Struct/object In MYSQL
I have the following structure. typedef __nogc struct RemoteDisplayInfoType{ int HistData [512][512]; int channelNdx; double xVar[2]; double yVar[2]; double paAngle[2]; }RemoteDisplayInfoType; I want to store this in MySQl database and retreive it back. I am using ADO.Net with managed c++.
View Replies !
“best-practice” Approach For Storing Form Structures And Their Data
I’m looking for a “best-practice” approach to creating a db structure that will handle form creation and storage dynamically. FORM CREATION The idea is to allow the client to create forms for their products by specifying attributes and values that belong to a product category. The client will: 1.Enter a category # and name. 2.Enter the attributes available to the category. 3.Enter the values available for those attributes. The application will: 4.Deduce the form based on what the client enters. FORM STORAGE What’s the best approach for then storing the form attribute/value pairs? Is this a “wise” approach or is better to "hard-code" the forms with html and/or use a look-up table for the allowed attribute values of the fields? Do any of you have experience with this concept? Do you have any thoughts on it or a link to further reading?
View Replies !
Storing As An Array - Vs. - Storing In A Relational Table
Store in a relational table Code: [.....] Scenario 1 would have more complex table joins, but would establish the ground rules using the table's naming conventions. Scenario 2 seems like the better option because it is easier to read and write to and rely s on the programming language to do the heavy lifting. For example, to read the array's stored, I would have to use a script function to determine what array=1 is and give it a value beforehand using a script. Where the first scenario, I would just pull the value from the table for array=1.
View Replies !
Db Accounts
Does anyone know of a good isp where I can pay for just the use of a mysql database? I don't know when my provider (pair nwetworks) is going to upgrade and I absolutely need the latest version with unicode support as I need to have many different scripts in the same table.
View Replies !
Accounts
also, can someone please tell me what is the relationship/difference/similarity and interaction betweeen: 1.phpmyadmin login/access 2.mysql login/access 3.database login/access if a user signs up on my website, how can i give him a separate db automatically upon sign up, with default tables and access to only his db with his login username and password? also, before accessing his own db, will he connect to the mysql server using a diff p/w?..how exactly will it work?
View Replies !
MySql - Accounts
What privileges does a user need to be able to create new accounts? I have an account with all privileges including the grant privilege, but when I try to create a new user with this account, I always get an access denied error. I'm using an old mySql Version (3.22.32) and a windows-client with an ODBC connection. There is no problem to connect, select or update any data in my database, only with my superuser, only the creation of new user fail.
View Replies !
MySQL Accounts
When I installed mySQL I created administrator account with a different name to root and set a password. Having just had a look there's 5 accounts: root (host set to: localhost) root (host set to: %) localhost (host is blank) % (host is blank) my administrator account (host set to: %) Can I safely delete root, root, localhost and % accounts? All of my server applications user the administrator account I created.
View Replies !
Mutiple Accounts
I am looking for a solution for this and havent been able to find it anywhere i think i am searching for the wrong keywords or strings... i want to be able to allow users to create there own database's in there account but limit the database's that they can create to a prefix on every data base (diffrent prefix for diffrent users)Also is it possible they can create users that only have access to the database's in the master account?.i am trying to stay out of the admin role as much as possible it's just internal office applications that staff can use mostly a sandbox so security is not an issue.
View Replies !
MYSQL Password Accounts
I have been having problems with password accounts in MySQL. I'm setting up the environment for the first time. from the mysql website the intructions are to set the password on Windows: shell> mysql -u root mysql>SET password ......... My question is where do i access "shell>" to start off the code I have little expreience in writing in the command window so I do apologise if this question is overly remedial
View Replies !
User Accounts With Passwords
I am able to connect to the database using users that are not password protected. After updating privileges to use passwords and changing login info(in a php document) I recieve the following error from the php document: Warning: mysql_query(): Access denied for user 'ODBC'@'localhost' (using password: NO) in c:inetpubwwwrootgindex.php on line 9 Warning: mysql_query(): A link to the server could not be established in c:inetpubwwwrootgindex.php on line 9 I am attempting to connect as 'test'@'localhost' with the password 'test'. If I remove the password, I can connect no problem.
View Replies !
Setting Up New Mysql Accounts
I have followed the manual for MySQL 5.0 for adding new accounts to MySQL but it will not work for me. I am typing these commands on the root on the actual computer with Every time I input these following commands, the command just returns this: mysql> Query OK, 0 rows affected (0.00 sec) mysql> GRANT ALL PRIVILEGES ON *.* TO 'myusername'@'localhost' -> IDENTIFIED BY 'mypass' WITH GRANT OPTION; mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP -> ON mydatabase.* -> TO 'myusername'@'localhost' -> IDENTIFIED BY 'mypassword'; I've also tried this one mysql> CREATE USER 'myusername'@'localhost' IDENTIFIED BY 'mypassword'; But it returns mysql> ERROR (HY000): Opteration CREATE USER failed for 'myusername'@'localhost' .
View Replies !
User Accounts Not Recognized
I am the administrator and asks for my password (that's ok because I am the administrator). The downside is, no where did it ask me for a user name. I've tried using "root", because, well it is the root file and I am the administrator. Just to test this out, I set up another account and password. MySQL acknowledged it and going through and being set up correctly, but I can't log on as that person or access it through PHP. I was reading in the reference manual that GRANT files should be automatically set up. When I go into my MySQL file,I don't see anything there regarding grants or privileges or users. When I start writing PHP to create and access databases, how will it recognize me if I never set up a user name? Perhaps this should be in the PHP forum?
View Replies !
Sum, Union And Balancing Accounts
One of my clients has a very complex accounts system, which has issues that I've been brought in to fix. The first stage I want to start with is a report showing which transactions don't balance. Code:
View Replies !
Setting Up Initial Accounts In MySQL
I'm a newbie to MySQL. In setting up my initial accounts, I see two anonymous users in the mysql database in the user table. My book says to delete them which I did, but I still see what looks like two root accounts. Is this normal? If not, which one do I delete? I see one doesn't yet have a password; should I delete the one without a password? First I'll log out and log back in as root to see if that other root user is a phantom or is really an account. Next, I'll need to add a few users, but I need to make sure this root thing is correct. Here's a screen shot of wht I did: mysql> use mysql Database changed mysql> select user.user from user; +------+ | user | +------+ | | | root | | | | root | +------+ 4 rows in set (0.02 sec) mysql> delete from user where user=''; Query OK, 2 rows affected (0.01 sec) mysql> select user.user from user; +------+ | user | +------+ | root | | root | +------+ 2 rows in set (0.00 sec)
View Replies !
USer Accounts Creation With MySQL
I am trying to create a website that uses ASP.NET interfacing wth a MySQL database, this is more of a Design based question (I think!). I need users to automatically register an ccount online and create entries within the tables in a specific database. How do I manage this, do i have to create a new user each time by the query GRANT? If so I am planning to have many users logging in to a big table that has a lot of other data for other users (they will be identofoable by an ID column i.e Joe_Bloggs). what do I set as permissions to that particular table, as potentially they could change someone elses information. I may just need a pointer to how you actually go about designing a system as I have described and manage all the users information to allow a good level of security and scalability for expanding the application at a later date. Is it better just to create a new table within the databse each time a new user is created as that way I would be able to grant that particular table (i.e. Joe_Bloggs_Table) the correct permmisions.
View Replies !
Backup/restore User Accounts
I have mysql 5.0.14? installed. I need to make a fresh installation of 5.0.18 (no update). I can create a backup of my database (export) and import it into the new version. But how can I migrate my useraccounts? The probem is, I tried re-creating a user with same pwd in the new version, assigned privileges to that user and the user to my freshly imported database, but when trying to access the DB using a script, it tells me that "user" has no access.
View Replies !
Connect To Database With Passworded Accounts
I am migrating my databases from mysql 4.0.x to 4.1.7 and i'm having the following problem: When i create accounts with passwords, i can't connect to databases with them. It only works with non-passworded accounts. I tried to put old_passwords=yes in my my.ini file, but it didn't work.
View Replies !
Adding New User Accounts :: Access Denied
I have read Ref Manual 5.9.2 Adding New User Accounts and 5.8.8 Causes of Access Denied. I am running SUSE 10.1: /usr/sbin/mysqld Ver 5.0.18 for suse-linux on i686 (SUSE MySQL RPM) This works: mysql -u root -ppassword mysql Using user root, from Python I can access sql, add data to tables, etc. but I want to set up other users and access mysql from other than localhost. I tried this (as suggested in 5.9.2): mysql> GRANT ALL PRIVILEGES ON *.* TO 'pwh'@'localhost' -> IDENTIFIED BY 'password' WITH GRANT OPTION; mysql> GRANT ALL PRIVILEGES ON *.* TO 'pwh'@'%' -> IDENTIFIED BY 'password' WITH GRANT OPTION; But this happens: mysql -u pwh -ppassword ERROR 1045 (28000): Access denied for user 'pwh'@'localhost' (using password: YES) Ref man 5.8.8 says if all else fails, reinstall from the source. I started to do that but got stuck. I would rather not if it can be avoided.
View Replies !
Number Of User Accounts For Large Database
I have a large database (816 tables with 11 fields each, each field could hold up to 50 entires) and I'd like to know if each table should have its own user account (created in Cpanel and used in the config file to access the database). May sound like a simple question to some but I need to know in case we have a lot of traffic and 1 user account is not "enough" for all visitors to access the database info.
View Replies !
How To Save Accounts Based On Variable Amounts Of Time
I'm currently building a website where users can signup for various accounts. An account may last 30 days, 12 months or 24 months. If a user's account is about to expire, an email notification is send, via a CRON Job. I want to save the different account types in the database, but I'm not sure how to save the duration of an account. If it was all months, I could simply save ཈' or པ' as an INT, but it also has an account for 30 days, which is more flexible. Edit: It would also be nice if I could ORDER BY duration..
View Replies !
What's The Most Efficient Way?
I've done a database scheme and wonder what the most efficient way of storing certain entries would be. The site will have news, reviews and tutorials and these will be under the same categories. So I'm wondering what the best way to do design the database scheme would be. Have one table like I've done now in the "content" table with the posibilty to differentiate the entries with the "post_type" field or have three different tables? Below is the table "content". Field Type Null Default post_id int(10) No post_date datetime No 0000-00-00 00:00:00 post_text text No post_title text No post_cat_id int(4) No 0 post_description text No post_name varchar(200) No post_type int(4) No 0
View Replies !
How Efficient Is In() , And How Much Is The Most That You Should Put In An In()?
I am just wondering as to the efficiency of the in() function in MySQL. select field1,field2,...,fieldn from table where id in(1,2,3,4,5,6, ... , n); assuming: id is an indexed field. table is a VERY big table (100 000+ - 1 million+ records) what do you think is the largest number of values you could pass to the in() function without completly flattening your server?
View Replies !
Most Efficient YES/NO...
I) Table_A has fields Data_1, Data_2, Data_3, and Data_4; I need to determine whether value 'X' is present (at least once) in any of the Data_N fields. All I need is a YES/NO answer: YES, 'X' is present (at least once) in one of the Data_N fields of Table_A [Record number(s) not required!], or NO, 'X' is not present in any of the Data_N fields in any of the records in Table_A. II) Similar scenario, but this time Table_A has fields RecID, Data_1, Data_2, Data_3, and Data_4. I need to determine the RecID (none, one, or more) of every record that has value 'X' in any of the Data_N fields. I'm looking for the query that will be fastest and most elegant to implement.
View Replies !
Quickest And Most Efficient
i run an online game. I want to give each user a ranking, based on how high thier score is.If for example, i had 20,000 players, i dont want to have to update them all one by one, it may strain the server and take a long time. Is there another way i can assign a rank number (rank 1 has the top score and so on)
View Replies !
Efficient UPDATE
I have a table with the following structure; CREATE TABLE my_table ( id_1 int(11) NOT NULL , id_2 int(10) NOT NULL , stauts tinyint(1) NOT NULL DEFAULT 0 , PRIMARY KEY (id_1) ) Engine =InnoDB'; The table currently has arround 100,000 entries. When I try to run variations of the following statement it is taking around 4 seconds per query; UPDATE IGNORE my_table SET id_1 = 74240, id_2 = 5 I need it to be running a lot faster than 4 seconds per query as I need to update upwards of 100,000 records a day! My server is fairly beefy, a 3 gig dual core opeteron and is generaly running below 1.0 load.
View Replies !
|